OpenAILike LLM and embedding clients at Venice’s base URL and keep using the rest of the LlamaIndex API as usual.
Prerequisites
- Python 3.9 or later
- A Venice API key
Setup
Install LlamaIndex with the OpenAI-compatible LLM and embedding integrations:Configure Venice as the LLM
Venice speaks the OpenAI Chat Completions API. UseOpenAILike with Venice’s base URL and set is_chat_model=True:
Set
context_window to match the model you pick — OpenAILike can’t infer it for non-OpenAI model IDs. Set is_function_calling_model=True only for models that support function calling.Chat messages
Streaming
Global defaults with Settings
Set Venice models once viaSettings and every index, query engine, and agent will use them:
Embeddings
RAG pipeline
Build a retrieval-augmented query engine over your documents. This uses theSettings.llm and Settings.embed_model configured above:
SimpleDirectoryReader:
Agents and tools
UseFunctionAgent to give Venice models tool access. Pick a model that supports function calling:
Structured output
Wrap the LLM withas_structured_llm to validate the final answer against a Pydantic model:
Venice-specific parameters
Pass Venice-only options throughadditional_kwargs using extra_body. For example, enable built-in web search with venice_parameters:
extra_body per call:
venice_parameters list (web scraping, citations, characters, thinking controls, and E2EE toggles).
Recommended models
Model IDs rotate over time — confirm current IDs with
GET /models or the models overview.
Privacy advantage
LlamaIndex is typically used to build RAG systems over private documents, internal knowledge bases, and user data. Pairing it with Venice keeps that pipeline on private, uncensored inference:- Zero data retention on private models — prompts, retrieved chunks, and tool payloads are not kept after the request
- Uncensored analysis when your data or questions would trip other providers’ filters
- OpenAI-compatible plumbing so you can migrate existing LlamaIndex apps by swapping the LLM and embedding clients for
OpenAILike
Troubleshooting
Model not found or unexpected endpoint errors
Model not found or unexpected endpoint errors
Use a current model ID from the models page. Set
api_base to https://api.venice.ai/api/v1 with no trailing path — LlamaIndex appends /chat/completions.Context window or token errors
Context window or token errors
OpenAILike can’t infer the context window for non-OpenAI model IDs. Set context_window explicitly to match the model you’re using.Tools are ignored
Tools are ignored
Set
is_function_calling_model=True and pick a model that supports function calling. Keep tool docstrings precise — LlamaIndex builds JSON schemas from signatures and docs.LlamaIndex Docs
Indexes, query engines, agents, and workflows
Venice Models
Browse models and supported capabilities