Prerequisites
Install
Use SDK adapter
Use theArbytraLlamaIndexLLM adapter:
ArbytraLlamaIndexLLM supports chat, completion, streaming, async, per-call routing overrides, and Arbytra error mapping.
Configure options
Configure routing
Pass aRoutingOptions instance to set default routing:
Configure manually
Alternative: configure LlamaIndex manually
Alternative: configure LlamaIndex manually
If you prefer to use LlamaIndex’s For routing options, per-call overrides, and Arbytra error mapping, use
OpenAI class directly: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.client.last_routing_metadata after each call. See ArbytraAsyncOpenAI for the full class reference.