Overview
Type: Framework or PlatformPrimary Path: OpenAI-compatible via OpenAILikeSupport Confidence: Supported via OpenAILike
OpenAILike for third-party OpenAI-compatible endpoints, because the built-in OpenAI classes infer metadata from official model names.
In other words: treat OpenAILike as the supported AI Sonar path here, not the built-in OpenAI classes.
Installation
Basic Configuration
Basic Usage
Minimal OpenAILike LLM
Chat
Streaming
Embeddings
RAG with Documents
Chat Engine
Async Usage
Best Practices
Use OpenAILike for AI Sonar
Use OpenAILike for AI Sonar
Prefer
llama_index.llms.openai_like.OpenAILike and llama_index.embeddings.openai_like.OpenAILikeEmbedding for AI Sonar and other third-party OpenAI-compatible gateways.Set api_base explicitly
Set api_base explicitly
Pass
api_base="https://api.aisonar.dev/v1" directly in code instead of relying on older OpenAI environment-variable names.Keep model roles separated
Keep model roles separated
Use chat/reasoning models for synthesis and
text-embedding-3-small or text-embedding-3-large for retrieval.