Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerizing Route-LLM 🚀 #33

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "-m", "routellm.openai_server", "--routers", "mf", "--strong-model", "gpt-4-1106-preview", "--weak-model", "anyscale/mistralai/Mixtral-8x7B-Instruct-v0.1"]
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ cd RouteLLM
pip install -e .[serve,eval]
```

## Docker
To run Route-LLM inside Docker:
```
git clone https://github.com/lm-sys/RouteLLM.git
cd RouteLLM
```
Add your keys and models in the **environment** section of docker-compose.yml:
```
environment:
- OPENAI_API_KEY=your_strong_model_key
- ANYSCALE_MODEL_KEY=your_weak_model_key
command: python -m routellm.openai_server --routers mf --strong-model openai/gpt4o --weak-model anyscale/mistralai/Mixtral-8x7B-Instruct-v0.1

```
Now simply use the docker-compose command.
```
docker-compose up
```

## Quickstart

Let's walkthrough replacing an existing OpenAI client to route queries between LLMs instead of using only a single model.
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'

services:
routellm:
build:
context: .
dockerfile: Dockerfile
ports:
- 6060:6060
volumes:
- ./config.example.yaml:/app/config.example.yaml # Mount the config file
environment:
- OPENAI_API_KEY=your_openai_api_key # Replace with your actual OpenAI API key
- GROQ_API_KEY=your_groq_api_key # Replace with your actual GR0Q_API_KEY, ANYSCALE_API_KEY ETC.
command: python -m routellm.openai_server --routers mf --strong-model openai/gpt4o --weak-model groq/llama3-8b-8192