mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
feat: add aiand provider
This commit is contained in:
parent
4ba8517134
commit
d56b224e01
6 changed files with 93 additions and 0 deletions
|
|
@ -786,6 +786,7 @@ openai_compatible_endpoints: Final[list] = [
|
|||
"https://api-inference.modelscope.cn/v1",
|
||||
"https://api.moonshot.ai/v1",
|
||||
"https://api.publicai.co/v1",
|
||||
"https://api.aiand.com/v1",
|
||||
"https://api.synthetic.new/openai/v1",
|
||||
"https://serverless.tensormesh.ai/v1",
|
||||
"https://api.stima.tech/v1",
|
||||
|
|
@ -843,6 +844,7 @@ openai_compatible_providers: Final[list] = [
|
|||
"novita",
|
||||
"meta_llama",
|
||||
"publicai", # PublicAI - JSON-configured provider
|
||||
"aiand", # ai& - JSON-configured provider
|
||||
"synthetic", # Synthetic - JSON-configured provider
|
||||
"tensormesh", # Tensormesh - JSON-configured provider
|
||||
"apertis", # Apertis - JSON-configured provider
|
||||
|
|
|
|||
|
|
@ -107,6 +107,12 @@
|
|||
"api_key_env": "AIHUBMIX_API_KEY",
|
||||
"api_base_env": "AIHUBMIX_API_BASE"
|
||||
},
|
||||
"aiand": {
|
||||
"base_url": "https://api.aiand.com/v1",
|
||||
"api_key_env": "AIAND_API_KEY",
|
||||
"api_base_env": "AIAND_API_BASE",
|
||||
"supported_endpoints": ["/v1/chat/completions", "/v1/responses"]
|
||||
},
|
||||
"crusoe": {
|
||||
"base_url": "https://managed-inference-api-proxy.crusoecloud.com/v1",
|
||||
"api_key_env": "CRUSOE_API_KEY",
|
||||
|
|
|
|||
|
|
@ -120,6 +120,23 @@
|
|||
"interactions": true
|
||||
}
|
||||
},
|
||||
"aiand": {
|
||||
"display_name": "ai& (`aiand`)",
|
||||
"url": "https://docs.aiand.com/api/chat-completions/",
|
||||
"endpoints": {
|
||||
"chat_completions": true,
|
||||
"messages": false,
|
||||
"responses": true,
|
||||
"embeddings": false,
|
||||
"image_generations": false,
|
||||
"audio_transcriptions": false,
|
||||
"audio_speech": false,
|
||||
"moderations": false,
|
||||
"batches": false,
|
||||
"rerank": false,
|
||||
"a2a": false
|
||||
}
|
||||
},
|
||||
"amazon_nova": {
|
||||
"display_name": "Amazon Nova (`amazon_nova`)",
|
||||
"url": "https://docs.litellm.ai/docs/providers/amazon_nova",
|
||||
|
|
|
|||
|
|
@ -3840,6 +3840,7 @@ class LlmProviders(str, Enum):
|
|||
POE = "poe"
|
||||
CHUTES = "chutes"
|
||||
NEOSANTARA = "neosantara"
|
||||
AIAND = "aiand"
|
||||
PARASAIL = "parasail"
|
||||
XIAOMI_MIMO = "xiaomi_mimo"
|
||||
TENSORMESH = "tensormesh"
|
||||
|
|
|
|||
|
|
@ -120,6 +120,23 @@
|
|||
"interactions": true
|
||||
}
|
||||
},
|
||||
"aiand": {
|
||||
"display_name": "ai& (`aiand`)",
|
||||
"url": "https://docs.aiand.com/api/chat-completions/",
|
||||
"endpoints": {
|
||||
"chat_completions": true,
|
||||
"messages": false,
|
||||
"responses": true,
|
||||
"embeddings": false,
|
||||
"image_generations": false,
|
||||
"audio_transcriptions": false,
|
||||
"audio_speech": false,
|
||||
"moderations": false,
|
||||
"batches": false,
|
||||
"rerank": false,
|
||||
"a2a": false
|
||||
}
|
||||
},
|
||||
"amazon_nova": {
|
||||
"display_name": "Amazon Nova (`amazon_nova`)",
|
||||
"url": "https://docs.litellm.ai/docs/providers/amazon_nova",
|
||||
|
|
|
|||
50
tests/test_litellm/llms/openai_like/test_aiand_provider.py
Normal file
50
tests/test_litellm/llms/openai_like/test_aiand_provider.py
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import pytest
|
||||
|
||||
import litellm
|
||||
from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider
|
||||
from litellm.llms.openai_like.dynamic_config import create_config_class
|
||||
from litellm.llms.openai_like.json_loader import JSONProviderRegistry
|
||||
from litellm.utils import ProviderConfigManager
|
||||
|
||||
AIAND_API_BASE = "https://api.aiand.com/v1"
|
||||
|
||||
|
||||
def test_aiand_chat_provider(monkeypatch: pytest.MonkeyPatch):
|
||||
monkeypatch.setenv("AIAND_API_KEY", "test-key")
|
||||
|
||||
provider_config = JSONProviderRegistry.get("aiand")
|
||||
assert provider_config is not None
|
||||
assert litellm.LlmProviders.AIAND.value == "aiand"
|
||||
assert "aiand" in litellm.openai_compatible_providers
|
||||
assert provider_config.base_url == AIAND_API_BASE
|
||||
assert provider_config.api_key_env == "AIAND_API_KEY"
|
||||
assert provider_config.api_base_env == "AIAND_API_BASE"
|
||||
|
||||
model, provider, api_key, api_base = get_llm_provider("aiand/openai/gpt-oss-120b")
|
||||
assert model == "openai/gpt-oss-120b"
|
||||
assert provider == "aiand"
|
||||
assert api_key == "test-key"
|
||||
assert api_base == AIAND_API_BASE
|
||||
|
||||
config = create_config_class(provider_config)()
|
||||
assert (
|
||||
config.get_complete_url(
|
||||
api_base=None,
|
||||
api_key=None,
|
||||
model=model,
|
||||
optional_params={},
|
||||
litellm_params={},
|
||||
)
|
||||
== f"{AIAND_API_BASE}/chat/completions"
|
||||
)
|
||||
|
||||
|
||||
def test_aiand_responses_provider():
|
||||
config = ProviderConfigManager.get_provider_responses_api_config(
|
||||
provider="aiand",
|
||||
model="aiand/openai/gpt-oss-120b",
|
||||
)
|
||||
|
||||
assert config is not None
|
||||
assert config.custom_llm_provider == "aiand"
|
||||
assert config.get_complete_url(api_base=None, litellm_params={}) == f"{AIAND_API_BASE}/responses"
|
||||
Loading…
Add table
Reference in a new issue