llama-index-llms-openai-like
llama-index llms openai like integration
What it is and what it does
This package bridges LlamaIndex and any API that speaks the OpenAI protocol—whether that's OpenAI itself, a local model server like Ollama or LM Studio, or a third-party provider. It's a thin adapter layer that lets you configure context window, chat vs. completion mode, and function-calling support, then use that model within LlamaIndex's indexing and retrieval workflows.
You install it alongside llama-index-core and llama-index-llms-openai, instantiate an OpenAILike object with your endpoint and model name, and pass it to LlamaIndex components that accept an LLM. It's most useful when you want to run inference locally or switch between providers without rewriting your LlamaIndex code.
Use it for:
- Run a local open-source model (via Ollama or similar) within LlamaIndex without vendor lock-in to OpenAI.
- Prototype or test LlamaIndex applications against a self-hosted LLM before deploying to a cloud provider.
- Switch between multiple OpenAI-compatible endpoints (staging, production, different providers) by changing configuration.
- Integrate a custom or fine-tuned model that exposes an OpenAI-compatible API into a LlamaIndex RAG pipeline.
- Evaluate cost or latency tradeoffs by routing LlamaIndex queries to different LLM providers at runtime.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a thin wrapper to use OpenAI-compatible APIs (including local models) within the LlamaIndex framework, allowing you to swap in alternative LLM providers that follow the OpenAI protocol.
Yes, if you're using LlamaIndex and want to use an OpenAI-compatible LLM that isn't OpenAI itself. Low friction, permissive license, no known vulnerabilities, and active maintenance make it a straightforward choice. Install it when you need local inference, multi-provider flexibility, or cost control in your LlamaIndex application.
Install
llama-index-llms-openai-like on PyPI
pip
pip install llama-index-llms-openai-likeuv
uv add llama-index-llms-openai-likepoetry
poetry add llama-index-llms-openai-likeInstalling llama-index-llms-openai-like
Before you install
Low install friction with just two runtime dependencies (llama-index-core and llama-index-llms-openai). Actively maintained as of the latest release.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both commercial and open-source projects.
Quickstart
pip install llama-index-llms-openai-like
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(
model="model-name",
api_base="http://localhost:1234/v1",
api_key="fake",
context_window=128000,
is_chat_model=True,
is_function_calling_model=False,
)
Requires Python 3.10 or later; you must have a running OpenAI-compatible API endpoint (local or remote) to connect to.
Verify before relying
- Whether the wrapper handles all OpenAI API features or only a subset (streaming, vision, embeddings, etc.)
- Performance overhead or latency impact compared to direct OpenAI client usage
- Specific OpenAI-compatible providers tested or officially supported
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 — llama-index-core, llama-index-llms-openai |
| Maintenance | actively maintained — 113 days since the last release |
| First released | |
| Downloads | 436,417/month — #6,675 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: llama_index_llms_openai_like-0.7.2-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
llama-cpp-pythonPython bindings for llama.cpp that enable…
permissive · top 15,000 on PyPI
llama-index-llms-litellmIntegrates LiteLLM with LlamaIndex to provide…
permissive · top 15,000 on PyPI
llama-index-multi-modal-llms-openaiIntegrates OpenAI's multi-modal language models…
permissive · top 5,000 on PyPI
llama-index-llms-langchainBridges LlamaIndex with LangChain LLM…
permissive · top 15,000 on PyPI
llama-index-llms-openaiIntegrates OpenAI's language models into…
permissive · top 1,000 on PyPI
llama-index-agent-openaiIntegrates OpenAI language models with…
permissive · top 5,000 on PyPI
models-devProvides a typed Python interface to…
permissive · top 15,000 on PyPI
llama-index-llms-azure-openaiIntegrates Azure OpenAI language models into…
permissive · top 15,000 on PyPI
llama-index-llms-vertexIntegrates Google Vertex AI's LLM capabilities…
permissive · top 15,000 on PyPI
llama-index-legacyLlamaIndex Legacy is a data framework for…
permissive · top 5,000 on PyPI