Skip to main content
Use Arbytra as your LLM provider in LlamaIndex. This integration is Python-only. For TypeScript, use the Vercel AI SDK integration.

Prerequisites

Install

Use SDK adapter

Use the ArbytraLlamaIndexLLM adapter:
ArbytraLlamaIndexLLM supports chat, completion, streaming, async, per-call routing overrides, and Arbytra error mapping.

Configure options

Configure routing

Pass a RoutingOptions instance to set default routing:
Per-call routing overrides the instance default:
Access routing metadata from the response:

Configure manually

If you prefer to use LlamaIndex’s OpenAI class directly:
For routing options, per-call overrides, and Arbytra error mapping, use ArbytraLlamaIndexLLM.

Use ArbytraAsyncOpenAI (experimental)

If your project pins a different llama-index-llms-openai version, pass ArbytraAsyncOpenAI as the async_openai_client:
LlamaIndex’s OpenAI requires an api_key for construction. Pass any placeholder value.
Read client.last_routing_metadata after each call. See ArbytraAsyncOpenAI for the full class reference.