Use LiteLLM with Autarcho
LiteLLM routes to any endpoint that speaks the OpenAI shape. Adding this one is a base URL and a model id, in the config or in the call.
The change
Register the model with api_base and the openai/ prefix.
# config.yaml, then: litellm --config config.yaml
model_list:
- model_name: small
litellm_params:
model: openai/lfm2-1.2b-extract@1.0
api_base: https://api.autarcho.com/v1
api_key: os.environ/AUTARCHO_API_KEY
- model_name: medium
litellm_params:
model: openai/lfm2-2.6b-transcript@1.0
api_base: https://api.autarcho.com/v1
api_key: os.environ/AUTARCHO_API_KEY A key is ak_ followed by 64 hex characters, made on your own machine; the start page covers making one and adding credit. Model ids come from the catalogue.
What works
- One proxy in front of several clients, each holding only its own key.
- Fallbacks between models: LiteLLM retries with the next entry, and a request that never produced text is not charged here.
- Spend tracking, because
usage.cost_micro_usdcis in every response for a cost callback to read.
What to watch
- The
openai/prefix is what tells LiteLLM to use the OpenAI shape rather than a vendor driver. - A retry after a stream cut is charged for the tokens that arrived; that is what makes it not free inference.
- Check the model id against
GET /v1/modelsrather than copying one from a page that has aged.
The full list of what is refused, what is charged and what a retry costs is on the API reference.