LiteLLM z NordRouter
Instalacja:
bash
pip install litellmpython
import os
from litellm import completion
response = completion(
model="openai/anthropic/claude-sonnet-4.6",
api_base="https://nordrouter.com/v1",
api_key=os.environ["NORDROUTER_API_KEY"],
messages=[{"role": "user", "content": "Ответь: работает"}],
)
print(response.choices[0].message.content)Przedrostek openai/ wybiera adapter LiteLLM. NordRouter powinien otrzymać pozostały pełny identyfikator anthropic/claude-sonnet-4.6.
Jeśli widzisz w logach dodatkowy prefiks, sprawdź wersję LiteLLM i włączony tryb przesyłania ID modelu.
Oficjalne informacje:LiteLLM Docs.