mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
feat(providers): add Latitude AI as OpenAI-compatible provider
Adds Latitude AI (https://latitude.sh) as a new inference provider. ## Changes - Add Latitude to openai_like/providers.json - Add model pricing for 7 models in model_prices_and_context_window.json - Add documentation in docs/providers/latitude.md ## Models Added - latitude/qwen-2.5-7b (131K context) - latitude/llama-3.1-8b (128K context) - latitude/qwen3-32b (131K context) - latitude/gemma-2-27b (8K context) - latitude/deepseek-r1-distill-14b (64K context) - latitude/qwen2.5-coder-32b (131K context) - latitude/qwen-2.5-vl-7b (32K context, vision) ## Features Supported - Streaming - Tool/function calling - JSON mode - Vision (qwen-2.5-vl-7b) ## API - Base URL: https://api.lsh.ai/v1 - Auth: Bearer token (LATITUDE_API_KEY) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
667b9122e0
commit
29328eebd8
3 changed files with 209 additions and 0 deletions
126
docs/my-website/docs/providers/latitude.md
Normal file
126
docs/my-website/docs/providers/latitude.md
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
# Latitude AI
|
||||
|
||||
[Latitude](https://latitude.sh) is a GPU cloud provider offering OpenAI-compatible inference APIs for open-source LLMs.
|
||||
|
||||
## API Keys
|
||||
|
||||
```python
|
||||
import os
|
||||
os.environ["LATITUDE_API_KEY"] = "lat_..."
|
||||
```
|
||||
|
||||
Get your API key from [Latitude AI Dashboard](https://ai.latitude.sh).
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="latitude/qwen-2.5-7b",
|
||||
messages=[{"role": "user", "content": "Hello, how are you?"}]
|
||||
)
|
||||
print(response.choices[0].message.content)
|
||||
```
|
||||
|
||||
## Streaming
|
||||
|
||||
```python
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="latitude/llama-3.1-8b",
|
||||
messages=[{"role": "user", "content": "Write a poem about AI"}],
|
||||
stream=True
|
||||
)
|
||||
|
||||
for chunk in response:
|
||||
print(chunk.choices[0].delta.content or "", end="")
|
||||
```
|
||||
|
||||
## Supported Models
|
||||
|
||||
| Model | Context | Max Output | Features |
|
||||
|-------|---------|------------|----------|
|
||||
| `latitude/qwen-2.5-7b` | 131K | 8K | Tools, JSON mode |
|
||||
| `latitude/llama-3.1-8b` | 128K | 8K | Tools, JSON mode |
|
||||
| `latitude/qwen3-32b` | 131K | 8K | Tools, JSON mode |
|
||||
| `latitude/gemma-2-27b` | 8K | 8K | Tools, JSON mode |
|
||||
| `latitude/deepseek-r1-distill-14b` | 64K | 8K | Tools, JSON mode, Reasoning |
|
||||
| `latitude/qwen2.5-coder-32b` | 131K | 8K | Tools, JSON mode |
|
||||
| `latitude/qwen-2.5-vl-7b` | 32K | 8K | Tools, JSON mode, Vision |
|
||||
|
||||
## Tool Calling
|
||||
|
||||
```python
|
||||
from litellm import completion
|
||||
|
||||
tools = [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "get_weather",
|
||||
"description": "Get the weather in a location",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {"type": "string", "description": "City name"}
|
||||
},
|
||||
"required": ["location"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
response = completion(
|
||||
model="latitude/qwen-2.5-7b",
|
||||
messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
|
||||
tools=tools
|
||||
)
|
||||
```
|
||||
|
||||
## JSON Mode
|
||||
|
||||
```python
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="latitude/qwen-2.5-7b",
|
||||
messages=[{"role": "user", "content": "List 3 colors as JSON"}],
|
||||
response_format={"type": "json_object"}
|
||||
)
|
||||
```
|
||||
|
||||
## Vision (qwen-2.5-vl-7b)
|
||||
|
||||
```python
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="latitude/qwen-2.5-vl-7b",
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{"type": "text", "text": "What's in this image?"},
|
||||
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
|
||||
]
|
||||
}
|
||||
]
|
||||
)
|
||||
```
|
||||
|
||||
## Supported Parameters
|
||||
|
||||
| Parameter | Supported |
|
||||
|-----------|-----------|
|
||||
| `temperature` | ✅ |
|
||||
| `max_tokens` | ✅ |
|
||||
| `top_p` | ✅ |
|
||||
| `stop` | ✅ |
|
||||
| `presence_penalty` | ✅ |
|
||||
| `frequency_penalty` | ✅ |
|
||||
| `seed` | ✅ |
|
||||
| `tools` | ✅ |
|
||||
| `response_format` | ✅ |
|
||||
| `stream` | ✅ |
|
||||
|
|
@ -15,6 +15,11 @@
|
|||
"base_url": "https://ai-gateway.helicone.ai/",
|
||||
"api_key_env": "HELICONE_API_KEY"
|
||||
},
|
||||
"latitude": {
|
||||
"base_url": "https://api.lsh.ai/v1",
|
||||
"api_key_env": "LATITUDE_API_KEY",
|
||||
"api_base_env": "LATITUDE_API_BASE"
|
||||
},
|
||||
"veniceai": {
|
||||
"base_url": "https://api.venice.ai/api/v1",
|
||||
"api_key_env": "VENICE_AI_API_KEY"
|
||||
|
|
|
|||
|
|
@ -19633,6 +19633,84 @@
|
|||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"latitude/deepseek-r1-distill-14b": {
|
||||
"input_cost_per_token": 1.44e-06,
|
||||
"litellm_provider": "latitude",
|
||||
"max_input_tokens": 64000,
|
||||
"max_output_tokens": 8192,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 1.44e-06,
|
||||
"supports_function_calling": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"latitude/gemma-2-27b": {
|
||||
"input_cost_per_token": 4.5e-07,
|
||||
"litellm_provider": "latitude",
|
||||
"max_input_tokens": 8192,
|
||||
"max_output_tokens": 8192,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4.5e-07,
|
||||
"supports_function_calling": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"latitude/llama-3.1-8b": {
|
||||
"input_cost_per_token": 1.6e-07,
|
||||
"litellm_provider": "latitude",
|
||||
"max_input_tokens": 128000,
|
||||
"max_output_tokens": 8192,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 1.6e-07,
|
||||
"supports_function_calling": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"latitude/qwen-2.5-7b": {
|
||||
"input_cost_per_token": 2.7e-07,
|
||||
"litellm_provider": "latitude",
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 8192,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 2.7e-07,
|
||||
"supports_function_calling": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"latitude/qwen-2.5-vl-7b": {
|
||||
"input_cost_per_token": 3.6e-07,
|
||||
"litellm_provider": "latitude",
|
||||
"max_input_tokens": 32768,
|
||||
"max_output_tokens": 8192,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 3.6e-07,
|
||||
"supports_function_calling": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true
|
||||
},
|
||||
"latitude/qwen2.5-coder-32b": {
|
||||
"input_cost_per_token": 7.2e-07,
|
||||
"litellm_provider": "latitude",
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 8192,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 7.2e-07,
|
||||
"supports_function_calling": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"latitude/qwen3-32b": {
|
||||
"input_cost_per_token": 4.5e-07,
|
||||
"litellm_provider": "latitude",
|
||||
"max_input_tokens": 131072,
|
||||
"max_output_tokens": 8192,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 9e-07,
|
||||
"supports_function_calling": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"j2-light": {
|
||||
"input_cost_per_token": 3e-06,
|
||||
"litellm_provider": "ai21",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue