Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Adding UI portion for Agents MD

yuneng-jiang901d145b1a83
diff --git a/AGENTS.md b/AGENTS.md
index 2c778dc0d71..61afbd035fe 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -49,6 +49,27 @@ LiteLLM is a unified interface for 100+ LLMs that:
- Test provider-specific functionality thoroughly
- Consider adding load tests for performance-critical changes
+### MAKING CODE CHANGES FOR THE UI (IGNORE FOR BACKEND)
+
+1. **Use Common Components as much as possible**:
+ - These are usually defined in the `common_components` directory
+ - Use these components as much as possible and avoid building new components unless needed
+ - Tremor components are deprecated; prefer using Ant Design (AntD) as much as possible
+
+2. **Testing**:
+ - The codebase uses **Vitest** and **React Testing Library**
+ - **Query Priority Order**: Use query methods in this order: `getByRole`, `getByLabelText`, `getByPlaceholderText`, `getByText`, `getByTestId`
+ - **Always use `screen`** instead of destructuring from `render()` (e.g., use `screen.getByText()` not `getByText`)
+ - **Wrap user interactions in `act()`**: Always wrap `fireEvent` calls with `act()` to ensure React state updates are properly handled
+ - **Use `query` methods for absence checks**: Use `queryBy*` methods (not `getBy*`) when expecting an element to NOT be present
+ - **Test names must start with "should"**: All test names should follow the pattern `it("should ...")`
+ - **Mock external dependencies**: Check `setupTests.ts` for global mocks and mock child components/networking calls as needed
+ - **Structure tests properly**:
+ - First test should verify the component renders successfully
+ - Subsequent tests should focus on functionality and user interactions
+ - Use `waitFor` for async operations that aren't already awaited
+ - **Avoid using `querySelector`**: Prefer React Testing Library queries over direct DOM manipulation
+
### IMPORTANT PATTERNS
1. **Function/Tool Calling**: