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
Add LlamaGate as a new provider (#18673)
Lundin Matthews762345172cdd
diff --git a/docs/my-website/docs/providers/llamagate.md b/docs/my-website/docs/providers/llamagate.mdnew file mode 100644index 00000000000..bc362694771--- /dev/null+++ b/docs/my-website/docs/providers/llamagate.md@@ -0,0 +1,228 @@+# LlamaGate++## Overview++| Property | Details |+|-------|-------|+| Description | LlamaGate is an OpenAI-compatible API gateway for open-source LLMs with credit-based billing. Access 26+ open-source models including Llama, Mistral, DeepSeek, and Qwen at competitive prices. |+| Provider Route on LiteLLM | `llamagate/` |+| Link to Provider Doc | [LlamaGate Documentation ↗](https://llamagate.dev/docs) |+| Base URL | `https://api.llamagate.dev/v1` |+| Supported Operations | [`/chat/completions`](#sample-usage), [`/embeddings`](#embeddings) |++<br />++## What is LlamaGate?++LlamaGate provides access to open-source LLMs through an OpenAI-compatible API:+- **26+ Open-Source Models**: Llama 3.1/3.2, Mistral, Qwen, DeepSeek R1, and more+- **OpenAI-Compatible API**: Drop-in replacement for OpenAI SDK+- **Vision Models**: Qwen VL, LLaVA, olmOCR, UI-TARS for multimodal tasks+- **Reasoning Models**: DeepSeek R1, OpenThinker for complex problem-solving+- **Code Models**: CodeLlama, DeepSeek Coder, Qwen Coder, StarCoder2+- **Embedding Models**: Nomic, Qwen3 Embedding for RAG and search+- **Competitive Pricing**: $0.02-$0.55 per 1M tokens++## Required Variables++```python showLineNumbers title="Environment Variables"+os.environ["LLAMAGATE_API_KEY"] = "" # your LlamaGate API key+```++Get your API key from [llamagate.dev](https://llamagate.dev).++## Supported Models++### General Purpose+| Model | Model ID |+|-------|----------|+| Llama 3.1 8B | `llamagate/llama-3.1-8b` |+| Llama 3.2 3B | `llamagate/llama-3.2-3b` |+| Mistral 7B v0.3 | `llamagate/mistral-7b-v0.3` |+| Qwen 3 8B | `llamagate/qwen3-8b` |+| Dolphin 3 8B | `llamagate/dolphin3-8b` |++### Reasoning Models+| Model | Model ID |+|-------|----------|+| DeepSeek R1 8B | `llamagate/deepseek-r1-8b` |+| DeepSeek R1 Distill Qwen 7B | `llamagate/deepseek-r1-7b-qwen` |+| OpenThinker 7B | `llamagate/openthinker-7b` |++### Code Models+| Model | Model ID |+|-------|----------|+| Qwen 2.5 Coder 7B | `llamagate/qwen2.5-coder-7b` |+| DeepSeek Coder 6.7B | `llamagate/deepseek-coder-6.7b` |+| CodeLlama 7B | `llamagate/codellama-7b` |+| CodeGemma 7B | `llamagate/codegemma-7b` |+| StarCoder2 7B | `llamagate/starcoder2-7b` |++### Vision Models+| Model | Model ID |+|-------|----------|+| Qwen 3 VL 8B | `llamagate/qwen3-vl-8b` |+| LLaVA 1.5 7B | `llamagate/llava-7b` |+| Gemma 3 4B | `llamagate/gemma3-4b` |+| olmOCR 7B | `llamagate/olmocr-7b` |+| UI-TARS 1.5 7B | `llamagate/ui-tars-7b` |++### Embedding Models+| Model | Model ID |+|-------|----------|+| Nomic Embed Text | `llamagate/nomic-embed-text` |+| Qwen 3 Embedding 8B | `llamagate/qwen3-embedding-8b` |+| EmbeddingGemma 300M | `llamagate/embeddinggemma-300m` |++## Usage - LiteLLM Python SDK++### Non-streaming++```python showLineNumbers title="LlamaGate Non-streaming Completion"+import os+import litellm+from litellm import completion++os.environ["LLAMAGATE_API_KEY"] = "" # your LlamaGate API key++messages = [{"content": "What is the capital of France?", "role": "user"}]++# LlamaGate call+response = completion(+ model="llamagate/llama-3.1-8b",+ messages=messages+)++print(response)+```++### Streaming++```python showLineNumbers title="LlamaGate Streaming Completion"+import os+import litellm+from litellm import completion++os.environ["LLAMAGATE_API_KEY"] = "" # your LlamaGate API key++messages = [{"content": "Write a short poem about AI", "role": "user"}]++# LlamaGate call with streaming+response = completion(+ model="llamagate/llama-3.1-8b",+ messages=messages,+ stream=True+)++for chunk in response:+ print(chunk)+```++### Vision++```python showLineNumbers title="LlamaGate Vision Completion"+import os+import litellm+from litellm import completion++os.environ["LLAMAGATE_API_KEY"] = "" # your LlamaGate API key++messages = [+ {+ "role": "user",+ "content": [+ {"type": "text", "text": "What's in this image?"},+ {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}+ ]+ }+]++# LlamaGate vision call+response = completion(+ model="llamagate/qwen3-vl-8b",+ messages=messages+)++print(response)+```++### Embeddings++```python showLineNumbers title="LlamaGate Embeddings"+import os+import litellm+from litellm import embedding++os.environ["LLAMAGATE_API_KEY"] = "" # your LlamaGate API key++# LlamaGate embedding call+response = embedding(+ model="llamagate/nomic-embed-text",+ input=["Hello world", "How are you?"]+)++print(response)+```++## Usage - LiteLLM Proxy Server++### 1. Save key in your environment++```bash+export LLAMAGATE_API_KEY=""+```++### 2. Start the proxy++```yaml+model_list:+ - model_name: llama-3.1-8b+ litellm_params:+ model: llamagate/llama-3.1-8b+ api_key: os.environ/LLAMAGATE_API_KEY+ - model_name: deepseek-r1+ litellm_params:+ model: llamagate/deepseek-r1-8b+ api_key: os.environ/LLAMAGATE_API_KEY+ - model_name: qwen-coder+ litellm_params:+ model: llamagate/qwen2.5-coder-7b+ api_key: os.environ/LLAMAGATE_API_KEY+```++## Supported OpenAI Parameters++LlamaGate supports all standard OpenAI-compatible parameters:++| Parameter | Type | Description |+|-----------|------|-------------|+| `messages` | array | **Required**. Array of message objects with 'role' and 'content' |+| `model` | string | **Required**. Model ID |+| `stream` | boolean | Optional. Enable streaming responses |+| `temperature` | float | Optional. Sampling temperature (0-2) |+| `top_p` | float | Optional. Nucleus sampling parameter |+| `max_tokens` | integer | Optional. Maximum tokens to generate |+| `frequency_penalty` | float | Optional. Penalize frequent tokens |+| `presence_penalty` | float | Optional. Penalize tokens based on presence |+| `stop` | string/array | Optional. Stop sequences |+| `tools` | array | Optional. List of available tools/functions |+| `tool_choice` | string/object | Optional. Control tool/function calling |+| `response_format` | object | Optional. JSON mode or JSON schema |++## Pricing++LlamaGate offers competitive per-token pricing:++| Model Category | Input (per 1M) | Output (per 1M) |+|----------------|----------------|-----------------|+| Embeddings | $0.02 | - |+| Small (3-4B) | $0.03-$0.04 | $0.08 |+| Medium (7-8B) | $0.03-$0.15 | $0.05-$0.55 |+| Code Models | $0.06-$0.10 | $0.12-$0.20 |+| Reasoning | $0.08-$0.10 | $0.15-$0.20 |++## Additional Resources++- [LlamaGate Documentation](https://llamagate.dev/docs)+- [LlamaGate Pricing](https://llamagate.dev/pricing)+- [LlamaGate API Reference](https://llamagate.dev/docs/api)diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.jsindex 11effc82fe7..5d2f096156e 100644--- a/docs/my-website/sidebars.js+++ b/docs/my-website/sidebars.js@@ -737,6 +737,7 @@ const sidebars = {"providers/langgraph","providers/lemonade","providers/llamafile",+ "providers/llamagate","providers/lm_studio","providers/meta_llama","providers/milvus_vector_stores",diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.jsonindex a5455f4a6d1..206aee1359d 100644--- a/litellm/llms/openai_like/providers.json+++ b/litellm/llms/openai_like/providers.json@@ -60,5 +60,12 @@"param_mappings": {"max_completion_tokens": "max_tokens"}+ },+ "llamagate": {+ "base_url": "https://api.llamagate.dev/v1",+ "api_key_env": "LLAMAGATE_API_KEY",+ "param_mappings": {+ "max_completion_tokens": "max_tokens"+ }}}diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex 8921fee9b38..90b73e4709c 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -32168,6 +32168,181 @@"output_cost_per_token": 2e-07,"litellm_provider": "fireworks_ai","mode": "chat"+ },+ "llamagate/llama-3.1-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 131072,+ "max_output_tokens": 8192,+ "input_cost_per_token": 3e-08,+ "output_cost_per_token": 5e-08,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/llama-3.2-3b": {+ "max_tokens": 8192,+ "max_input_tokens": 131072,+ "max_output_tokens": 8192,+ "input_cost_per_token": 4e-08,+ "output_cost_per_token": 8e-08,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/mistral-7b-v0.3": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/qwen3-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 4e-08,+ "output_cost_per_token": 1.4e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/dolphin3-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 128000,+ "max_output_tokens": 8192,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/deepseek-r1-8b": {+ "max_tokens": 16384,+ "max_input_tokens": 65536,+ "max_output_tokens": 16384,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_reasoning": true+ },+ "llamagate/deepseek-r1-7b-qwen": {+ "max_tokens": 16384,+ "max_input_tokens": 131072,+ "max_output_tokens": 16384,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_reasoning": true+ },+ "llamagate/openthinker-7b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_reasoning": true+ },+ "llamagate/qwen2.5-coder-7b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 6e-08,+ "output_cost_per_token": 1.2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/deepseek-coder-6.7b": {+ "max_tokens": 4096,+ "max_input_tokens": 16384,+ "max_output_tokens": 4096,+ "input_cost_per_token": 6e-08,+ "output_cost_per_token": 1.2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/codellama-7b": {+ "max_tokens": 4096,+ "max_input_tokens": 16384,+ "max_output_tokens": 4096,+ "input_cost_per_token": 6e-08,+ "output_cost_per_token": 1.2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/qwen3-vl-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 1.5e-07,+ "output_cost_per_token": 5.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true+ },+ "llamagate/llava-7b": {+ "max_tokens": 2048,+ "max_input_tokens": 4096,+ "max_output_tokens": 2048,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_response_schema": true,+ "supports_vision": true+ },+ "llamagate/gemma3-4b": {+ "max_tokens": 8192,+ "max_input_tokens": 128000,+ "max_output_tokens": 8192,+ "input_cost_per_token": 3e-08,+ "output_cost_per_token": 8e-08,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true+ },+ "llamagate/nomic-embed-text": {+ "max_tokens": 8192,+ "max_input_tokens": 8192,+ "input_cost_per_token": 2e-08,+ "output_cost_per_token": 0,+ "litellm_provider": "llamagate",+ "mode": "embedding"+ },+ "llamagate/qwen3-embedding-8b": {+ "max_tokens": 40960,+ "max_input_tokens": 40960,+ "input_cost_per_token": 2e-08,+ "output_cost_per_token": 0,+ "litellm_provider": "llamagate",+ "mode": "embedding"}}