Skip to main content
LlamaIndex is a data framework for building RAG pipelines, agents, and query engines over your own data. Venice works as an OpenAI-compatible backend — point the OpenAILike LLM and embedding clients at Venice’s base URL and keep using the rest of the LlamaIndex API as usual.

Prerequisites

Setup

Install LlamaIndex with the OpenAI-compatible LLM and embedding integrations:
Add your Venice API key to the environment:
Keep API keys out of source control. Prefer environment variables or a secret manager in production.

Configure Venice as the LLM

Venice speaks the OpenAI Chat Completions API. Use OpenAILike 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 via Settings and every index, query engine, and agent will use them:

Embeddings

RAG pipeline

Build a retrieval-augmented query engine over your documents. This uses the Settings.llm and Settings.embed_model configured above:
To load your own files from a directory instead, use SimpleDirectoryReader:

Agents and tools

Use FunctionAgent to give Venice models tool access. Pick a model that supports function calling:

Structured output

Wrap the LLM with as_structured_llm to validate the final answer against a Pydantic model:
Browse models that support structured responses before relying on structured output in production.

Venice-specific parameters

Pass Venice-only options through additional_kwargs using extra_body. For example, enable built-in web search with venice_parameters:
You can also pass extra_body per call:
See the API specification for the full venice_parameters list (web scraping, citations, characters, thinking controls, and E2EE toggles). 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

Confirm VENICE_API_KEY is set in the process that runs your app. Restart the shell or process after changing environment variables.
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.
OpenAILike can’t infer the context window for non-OpenAI model IDs. Set context_window explicitly to match the model you’re using.
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