Prerequisites
Install
Use SDK adapter
Use theInfravelleLlamaIndexLLM adapter:
InfravelleLlamaIndexLLM supports chat, completion, streaming, async, per-call routing overrides, and Infravelle 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 Infravelle error mapping, use
OpenAI class directly:InfravelleLlamaIndexLLM.Use InfravelleAsyncOpenAI (experimental)
If your project pins a different llama-index-llms-openai version, pass InfravelleAsyncOpenAI 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 InfravelleAsyncOpenAI for the full class reference.