--- id: llama-index-llms-openai-like version: "0.7.2" license: MIT license_treatment: permissive maintenance: active --- # llama-index-llms-openai-like — llama-index llms openai like integration License: permissive · Maintenance: active · Downloads: 436.4K/mo ## 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 above — 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 pip install llama-index-llms-openai-like uv add llama-index-llms-openai-like poetry add llama-index-llms-openai-like ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 436.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags openai compatible llm wrapper, llamaindex openai-like integration, local llm with openai api, openai protocol adapter, llamaindex custom llm provider, openai-compatible model integration, llm api abstraction layer, llm-integration, openai-compatible, local-inference [View on SkillFed](https://skillfed.io/packages/llama-index-llms-openai-like) · [View on PyPI](https://pypi.org/project/llama-index-llms-openai-like/)