Installation and setup
LlamaIndex installs as a small core package plus one integration package for each model, embedding or store you plug in.
Last updated: 28 Sep, 2026 · LlamaIndex 0.14
Without a model set, LlamaIndex reaches for OpenAI for both answers and embeddings, which needs a paid key; the models guide describes the defaults. This course sets a local embedding model in the embeddings lesson and a stand-in answering model later, so no key is needed to run any example here.
Installing the core and two integrations
llama-index-core is the framework. The other two are integration packages, installed separately as LlamaIndex does for every model and store: local embeddings through Hugging Face, and keyword search with BM25. Allow about 1 GB of disk for PyTorch and two small models.
pip install "llama-index-core==0.14.25" "llama-index-embeddings-huggingface==0.8.0" "llama-index-retrievers-bm25==0.8.0"Check that Python finds the installed version:
from importlib.metadata import version
print(version("llama-index-core"))0.14.25
An answering model from a free providerOptional
If no model is set, LlamaIndex uses OpenAI for answers, so a real answer needs a key. This course never relies on that default: it sets a local embedding model in the next lessons and a stand-in answering model later. When you do want real answers, a hosted model is one integration package and one line in Settings.
from llama_index.core import Settings
from llama_index.llms.groq import Groq
Settings.llm = Groq(model="openai/gpt-oss-120b") # set GROQ_API_KEY firstFree providers and their packages
| Provider | Key | Variable | Package and class |
|---|---|---|---|
| Groq | Free, console.groq.com/keys | GROQ_API_KEY | llama-index-llms-groq, Groq(model="openai/gpt-oss-120b") |
| Gemini | Free, aistudio.google.com/apikey | GOOGLE_API_KEY | llama-index-llms-google-genai, GoogleGenAI(model="gemini-2.5-flash") |
| OpenRouter | Free models end in :free, openrouter.ai/keys | OPENROUTER_API_KEY | llama-index-llms-openrouter, OpenRouter(model="google/gemma-4-31b-it:free") |
| OpenAI | Paid, platform.openai.com/api-keys | OPENAI_API_KEY | llama-index-llms-openai, OpenAI(model="gpt-4o-mini") |
pip install "llama-index-llms-groq==0.6.0"export GROQ_API_KEY=gsk_...When to pin these versions
- Pin
llama-index-core==0.14.25while following the course, so an example's output matches what you read here. - Keep each integration package's major version in step with the core; a version-1 tutorial's imports will not match version 0.14.
- Drop the pins once you are comfortable and want the latest fixes, then re-run your own tests.
llama_index as one giant package. Version 0.14 splits that into llama-index-core plus one package per integration, so from llama_index import ... for an embedding or model will fail until you install and import its own package.Related
- Previous: LlamaIndex overview
- Next: Why retrieval: a model does not know your documents
- Reference: Installation guide
- Run
pip listand count the packages whose names start withllama-index. - Print
version("llama-index-embeddings-huggingface")and compare it with the pin above.
Little by little, you're building something great.