Menu: LiteLLM

Guides

LiteLLM

Use Scalaix as an OpenAI-compatible provider in the LiteLLM SDK and proxy.

Scalaix speaks the OpenAI API, so LiteLLM treats it as an openai/ provider with a custom api_base.

LiteLLM SDK

pip install litellm
import os
import litellm

reply = litellm.completion(
    model="openai/gpt-4o-mini",          # "openai/" + any Scalaix model id
    api_base="https://www.scalaix.com/v1",
    api_key=os.environ["SCALAIX_API_KEY"],
    messages=[{"role": "user", "content": "Hello from LiteLLM"}],
)
print(reply.choices[0].message.content)

Use openai/auto to let Scalaix route, or openai/claude-3-5-haiku-latest for an Anthropic model: Scalaix translates the request, so LiteLLM still sees an OpenAI response.

LiteLLM proxy

config.yaml
model_list:
  - model_name: fast
    litellm_params:
      model: openai/gpt-4o-mini
      api_base: https://www.scalaix.com/v1
      api_key: os.environ/SCALAIX_API_KEY
  - model_name: smart
    litellm_params:
      model: openai/claude-sonnet-4-5
      api_base: https://www.scalaix.com/v1
      api_key: os.environ/SCALAIX_API_KEY
  - model_name: routed
    litellm_params:
      model: openai/auto
      api_base: https://www.scalaix.com/v1
      api_key: os.environ/SCALAIX_API_KEY
litellm --config config.yaml

Clients of your proxy ask for fast, smart or routed. Budgets, caching, fallback and usage still apply per Scalaix key, so you can give each LiteLLM deployment its own key and see them separately in Usage.

If you already use LiteLLM's own fallbacks and caching, pick one place for each: either let LiteLLM do it or set fallback_models and cache on the Scalaix key, not both.