Installation and setup
LlamaIndex installs as a core package plus one integration per model or store. Left unset, it calls OpenAI; this course uses local and stand-in models instead.
llama-index-core and two integrations
llama-index-core is the framework. The other two are integrations, 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.24" "llama-index-embeddings-huggingface==0.8.0" "llama-index-retrievers-bm25==0.8.0"from importlib.metadata import version
print(version("llama-index-core"))An answering model from a free providerOptional
If no model is set, LlamaIndex uses OpenAI for answers and embeddings, which needs a paid key. The course sets a local embedding model in lesson 3 and a stand-in answering model in lesson 11, so neither default is used. A real answering 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")| 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_...- Run
pip listand count the packages whose names start withllama-index.
Little by little, you're building something great.