Installation and Setup
The LlamaIndex ecosystem is structured using a collection of namespaced python packages.
What this means for users is that pip install llama-index comes with a core starter bundle of packages, and additional integrations can be installed as needed.
A complete list of packages and available integrations is available on the integrations page.
Quickstart Installation from Pip
Section titled “Quickstart Installation from Pip”
To get started quickly, you can install with:
Terminal window
pip install llama-index
This is a starter bundle of packages, containing
llama-index-corellama-index-llms-openaillama-index-embeddings-openaillama-index-readers-file
NOTE: llama-index-core comes pre-bundled with NLTK and tiktoken files to avoid downloads and network calls at runtime.
Important: OpenAI Environment Setup
Section titled “Important: OpenAI Environment Setup”
By default, we use the OpenAI gpt-3.5-turbo model for text generation and text-embedding-ada-002 for retrieval and embeddings (for new projects we recommend passing model="text-embedding-3-small" explicitly). In order to use this, you must have an OPENAI_API_KEY set up as an environment variable. You can obtain an API key by logging into your OpenAI account and creating a new API key.
Tip
You can also use one of many other available LLMs. You may need additional environment keys + tokens setup depending on the LLM provider.
Check out our OpenAI Starter Example
Custom Installation from Pip
Section titled “Custom Installation from Pip”
If you aren’t using OpenAI, or want a more selective installation, you can install individual packages as needed.
For example, for a local setup with Ollama and HuggingFace embeddings, the installation might look like:
Terminal window
pip install llama-index-core llama-index-readers-file llama-index-llms-ollama llama-index-embeddings-huggingface
Check out our Starter Example with Local Models
A full guide to using and configuring LLMs is available here.
A full guide to using and configuring embedding models is available here.
Installation from Source
Section titled “Installation from Source”
Git clone this repository: git clone https://github.com/run-llama/llama_index.git. Then do the following:
- Install poetry - this will help you manage package dependencies
If you need to run shell commands using Poetry but the shell plugin is not installed, add the plugin by running:
poetry self add poetry-plugin-shellpoetry shell- this command creates a virtual environment, which keeps installed packages contained to this projectpip install -e llama-index-core- this will install the core package- (Optional)
poetry install --with dev,docs- this will install all dependencies needed for most local development
From there, you can install integrations as needed with pip, For example:
Terminal window
pip install -e llama-index-integrations/readers/llama-index-readers-file
pip install -e llama-index-integrations/llms/llama-index-llms-ollama
Note for AI agents: this documentation is built for programmatic access. - Overview of all docs: https://developers.llamaindex.ai/llms.txt - Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md - Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters. - A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/for-agents/mcp/ - Other LlamaIndex tooling for agents — the LlamaParse Platform MCP server, agent skills and plugins, and the n8n node — is mapped at https://developers.llamaindex.ai/for-agents/
[ Previous
High-Level Concepts ](/python/framework/getting_started/concepts/)[ Next
How to read these docs ](/python/framework/getting_started/reading/)
