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

feat: add vLLM model provider #968

Merged
merged 5 commits into from
Dec 20, 2024
Merged
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
8 changes: 8 additions & 0 deletions docs/docs/05-configuration/02-model-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ If this model provider hasn't been configured, then the API would return somethi
```

To configure a model provider using the API, a `POST` request can be made to `/api/model-providers/azure-openai-model-provider/configure` with each required configuration parameter set in the body:

```json
{
"OBOT_AZURE_OPENAI_MODEL_PROVIDER_ENDPOINT": "...",
Expand Down Expand Up @@ -107,3 +108,10 @@ Voyage is Anthropic's recommended text-embedding provider. The Voyage model prov
The Ollama model provider requires the configuration parameter `OBOT_OLLAMA_MODEL_PROVIDER_HOST`. This host must point to a running instance of Ollama. For your reference, the default host and port for Ollama is `127.0.0.1:11434`. Obot doesn't set this by default.

To set up and run an instance of Ollama, refer to the [Ollama GitHub readme](https://github.com/ollama/ollama/blob/main/README.md).

## vLLM

The vLLM model provider requires the following configuration parameters:

- `OTTO8_VLLM_MODEL_PROVIDER_ENDPOINT`: The endpoint to use for your vLLM server (e.g., `your-vllm-server.com` or `https://your-vllm-server.com`)
- `OTTO8_VLLM_MODEL_PROVIDER_API_KEY`: The API key for authentication with your vLLM server
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const translateUserFriendlyLabel = (label: string) => {
"OBOT_OLLAMA_MODEL_PROVIDER",
"OBOT_VOYAGE_MODEL_PROVIDER",
"OBOT_GROQ_MODEL_PROVIDER",
"OBOT_VLLM_MODEL_PROVIDER",
"OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER",
];

Expand Down
11 changes: 11 additions & 0 deletions ui/admin/app/components/model-providers/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const CommonModelProviderIds = {
OLLAMA: "ollama-model-provider",
GROQ: "groq-model-provider",
VLLM: "vllm-model-provider",
VOYAGE: "voyage-model-provider",
ANTHROPIC: "anthropic-model-provider",
OPENAI: "openai-model-provider",
Expand All @@ -12,6 +13,7 @@ export const ModelProviderLinks = {
[CommonModelProviderIds.VOYAGE]: "https://www.voyageai.com/",
[CommonModelProviderIds.OLLAMA]: "https://ollama.com/",
[CommonModelProviderIds.GROQ]: "https://groq.com/",
[CommonModelProviderIds.VLLM]: "https://docs.vllm.ai/",
[CommonModelProviderIds.AZURE_OPENAI]:
"https://azure.microsoft.com/en-us/explore/",
[CommonModelProviderIds.ANTHROPIC]: "https://www.anthropic.com",
Expand Down Expand Up @@ -42,6 +44,11 @@ export const ModelProviderRequiredTooltips: {
"Api Key":
"Groq API Key. Can be created and fetched from https://console.groq.com/keys",
},
[CommonModelProviderIds.VLLM]: {
Endpoint:
"Endpoint for the vLLM OpenAI service (eg. http://localhost:8000)",
"Api Key": "VLLM API Key set when starting the vLLM server",
},
[CommonModelProviderIds.AZURE_OPENAI]: {
Endpoint:
"Endpoint for the Azure OpenAI service (e.g. https://<resource-name>.<region>.api.cognitive.microsoft.com/)",
Expand Down Expand Up @@ -89,6 +96,10 @@ export const ModelProviderSensitiveFields: Record<string, boolean | undefined> =
// Groq
OBOT_GROQ_MODEL_PROVIDER_API_KEY: true,

// VLLM
OBOT_VLLM_MODEL_PROVIDER_ENDPOINT: false,
OBOT_VLLM_MODEL_PROVIDER_API_KEY: true,

// Anthropic Bedrock
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_ACCESS_KEY_ID: true,
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_SECRET_ACCESS_KEY: true,
Expand Down
1 change: 1 addition & 0 deletions ui/admin/app/routes/_auth.model-providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const sortModelProviders = (modelProviders: ModelProvider[]) => {
CommonModelProviderIds.OLLAMA,
CommonModelProviderIds.VOYAGE,
CommonModelProviderIds.GROQ,
CommonModelProviderIds.VLLM,
];
const aIndex = preferredOrder.indexOf(a.id);
const bIndex = preferredOrder.indexOf(b.id);
Expand Down
1 change: 1 addition & 0 deletions ui/admin/public/assets/vllm-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading