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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
docs: update UI contributing guide (#19353)
Cesar Garcia4d6a430adc87
diff --git a/docs/my-website/docs/contributing.md b/docs/my-website/docs/contributing.mdindex a88013ff1b3..be7222f6cb8 100644--- a/docs/my-website/docs/contributing.md+++ b/docs/my-website/docs/contributing.md@@ -1,45 +1,100 @@# Contributing - UI-Here's how to run the LiteLLM UI locally for making changes:+Thanks for contributing to the LiteLLM UI! This guide will help you set up your local development environment.+++## 1. Clone the repo-## 1. Clone the repo```bashgit clone https://github.com/BerriAI/litellm.git+cd litellm```-## 2. Start the UI + Proxy+## 2. Start the Proxy-**2.1 Start the proxy on port 4000**+Create a config file (e.g., `config.yaml`):++```yaml+model_list:+ - model_name: gpt-4o+ litellm_params:+ model: openai/gpt-4o++general_settings:+ master_key: sk-1234+ database_url: postgresql://<user>:<password>@<host>:<port>/<dbname>+ store_model_in_db: true+```++Start the proxy on port 4000:-Tell the proxy where the UI is located```bash-DATABASE_URL = "postgresql://<user>:<password>@<host>:<port>/<dbname>"-LITELLM_MASTER_KEY = "sk-1234"-STORE_MODEL_IN_DB = "True"+poetry run litellm --config config.yaml --port 4000```+The UI comes pre-built in the repo. Access it at `http://localhost:4000/ui`++## 3. UI Development++There are two options for UI development:++### Option A: Development Mode (Hot Reload)++This runs the UI on port 3000 with hot reload. The proxy runs on port 4000.+```bash-cd litellm/litellm/proxy-python3 proxy_cli.py --config /path/to/config.yaml --port 4000+cd ui/litellm-dashboard+npm install+npm run dev```-**2.2 Start the UI**+**Login flow:**+1. Go to `http://localhost:3000`+2. You'll be redirected to `http://localhost:4000/ui` for login+3. After logging in, manually navigate back to `http://localhost:3000/`+4. You're now authenticated and can develop with hot reload++:::note+If you experience redirect loops or authentication issues, clear your browser cookies for localhost or use Build Mode instead.+:::-Set the mode as development (this will assume the proxy is running on localhost:4000)+### Option B: Build Mode++This builds the UI and copies it to the proxy. Changes require rebuilding.++1. Make your code changes in `ui/litellm-dashboard/src/`++2. Build the UI```bash-npm install # install dependencies+cd ui/litellm-dashboard+npm install+npm run build```+After building, copy the output to the proxy:+```bash-cd litellm/ui/litellm-dashboard+cp -r out/* ../../litellm/proxy/_experimental/out/+```-npm run dev+Then restart the proxy and access the UI at `http://localhost:4000/ui`-# starts on http://0.0.0.0:3000+## 4. Submitting a PR++1. Create a new branch for your changes:+```bash+git checkout -b feat/your-feature-name```-## 3. Go to local UI+2. Stage and commit your changes:+```bash+git add .+git commit -m "feat: description of your changes"+```+3. Push to your fork:```bash-http://0.0.0.0:3000-```\ No newline at end of file+git push origin feat/your-feature-name+```++4. Create a Pull Request on GitHub following the [PR template](https://github.com/BerriAI/litellm/blob/main/.github/pull_request_template.md)