skillfed

llama-index-llms-litellm

llama-index llms litellm integration

llama-index-llms-litellm v0.7.1 81.3K downloads/30d#14,240 on PyPI
Permissive license MIT Active released

What it is and what it does

This package bridges LiteLLM and LlamaIndex, allowing you to use multiple LLM providers through LlamaIndex's standardized interface. Instead of writing provider-specific code for OpenAI, Cohere, or other services, you instantiate a single LiteLLM object with a model identifier and call the same methods—chat, complete, stream_chat, stream_complete, and async variants—regardless of which backend you're targeting.

The integration handles the translation between LlamaIndex's message and response formats and LiteLLM's provider abstractions. You set API keys as environment variables and switch providers by changing the model string passed to the LiteLLM constructor. It supports both synchronous and asynchronous calls, as well as streaming responses.

Use it for:

  • Build a RAG pipeline that can swap between OpenAI and Cohere without changing application code.
  • Prototype LLM features against multiple providers to compare cost, latency, or output quality.
  • Run LlamaIndex agents that fall back to alternative providers if one API is unavailable.
  • Implement multi-provider chat applications where users can select their preferred LLM backend.
  • Stream LLM responses in a LlamaIndex application without rewriting for each provider's API.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates LiteLLM with LlamaIndex to provide unified access to multiple LLM providers (OpenAI, Cohere, and others) through a single interface.

Yes, if you are building with LlamaIndex and need to support multiple LLM providers without provider-specific code. The low install friction, permissive license, active maintenance status, and lack of known vulnerabilities make it a straightforward choice. Install only if you actually need multi-provider flexibility; single-provider projects may not benefit.

Install

llama-index-llms-litellm on PyPI

pip

pip install llama-index-llms-litellm

uv

uv add llama-index-llms-litellm

poetry

poetry add llama-index-llms-litellm

Installing llama-index-llms-litellm

Before you install

Low install friction with just two runtime dependencies. Marked active with a recent release in 2026, though repository details are not publicly available.

License in practice

MIT license permits commercial and private use with minimal restrictions.

Quickstart

pip install llama-index-llms-litellm

from llama_index.llms.litellm import LiteLLM
from llama_index.core.llms import ChatMessage
import os

os.environ["OPENAI_API_KEY"] = "your-key"
message = ChatMessage(role="user", content="Hello")
llm = LiteLLM("gpt-3.5-turbo")
response = llm.chat([message])
print(response)

Requires Python 3.10 or later and valid API keys for the LLM providers you intend to use.

Verify before relying

  • Whether LiteLLM's full provider roster is accessible through this integration or only a subset
  • Performance characteristics and latency overhead of the abstraction layer
  • Whether streaming and async features work uniformly across all supported providers

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — litellm, llama-index-core
Maintenance actively maintained — 147 days since the last release
First released
Downloads 81,251/month — #14,240 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: llama_index_llms_litellm-0.7.1-py3-none-any.whl

Tags

litellm llama-index integrationmulti-provider llm wrapperopenai cohere unified apillm provider abstractionllamaindex litellm adapter
llm-integrationmulti-providerrag

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

llama-index-llms-langchain

Bridges LlamaIndex with LangChain LLM…

permissive · top 15,000 on PyPI

llama-index-llms-openai

Integrates OpenAI's language models into…

permissive · top 1,000 on PyPI

llama-index-llms-openai-like

Provides a thin wrapper to use…

permissive · top 15,000 on PyPI

llama-index-llms-google-genai

Integrates Google's Gemini models into…

permissive · top 15,000 on PyPI

llama-index-llms-bedrock

Integrates AWS Bedrock LLMs into LlamaIndex,…

permissive · top 15,000 on PyPI

llama-index-llms-ollama

Integrates local Ollama language models with…

permissive · top 15,000 on PyPI

pandasai-litellm

Integrates LiteLLM with PandasAI to enable…

permissive · top 15,000 on PyPI

llama-index-llms-azure-openai

Integrates Azure OpenAI language models into…

permissive · top 15,000 on PyPI

llama-index-llms-bedrock-converse

Integrates AWS Bedrock's Converse API with…

permissive · top 15,000 on PyPI

any-llm-sdk

Provides a unified Python interface to…

permissive · top 15,000 on PyPI

Further reading