llama-index 0.14.22
pip install llama-index
Released:
Interface between LLMs and your data
Navigation
Verified details
These details have been verified by PyPIMaintainers
π Avatar for jerryjliu from gravatar.comjerryjliu π Avatar for simonsdsuo from gravatar.com
simonsdsuo
Unverified details
These details have not been verified by PyPIProject links
Meta
-
License Expression: MIT
SPDX License Expression - Author: Jerry Liu
- Maintainer: Andrei Fajardo
- Tags LLM , NLP , RAG , data , devtools , index , retrieval
- Requires: Python <4.0, >=3.10
Project description
ποΈ LlamaIndex π¦
π PyPI - Downloads
π Build
π GitHub contributors
π Discord
π Twitter
π Reddit
π Ask AI
LlamaIndex OSS (by LlamaIndex) is an open-source framework to build agentic applications. Parse is our enterprise platform for agentic OCR, parsing, extraction, indexing and more. You can use LlamaParse with this framework or on its own; see LlamaParse below for signup and product links.
π Documentation:
Building with LlamaIndex typically involves working with LlamaIndex core and a chosen set of integrations (or plugins). There are two ways to start building with LlamaIndex in Python:
-
Starter:
llama-index. A starter Python package that includes core LlamaIndex as well as a selection of integrations. -
Customized:
llama-index-core. Install core LlamaIndex and add your chosen LlamaIndex integration packages on LlamaHub that are required for your application. There are over 300 LlamaIndex integration packages that work seamlessly with core, allowing you to build with your preferred LLM, embedding, and vector store providers.
The LlamaIndex Python library is namespaced such that import statements which
include core imply that the core package is being used. In contrast, those
statements without core imply that an integration package is being used.
# typical pattern fromllama_index.core.xxximport ClassABC # core submodule xxx fromllama_index.xxx.yyyimport ( SubclassABC, ) # integration yyy for submodule xxx # concrete example fromllama_index.core.llmsimport LLM fromllama_index.llms.openaiimport OpenAI
LlamaParse (document agent platform)
LlamaParse is its own platformβfocused on document agents and agentic OCR. It includes Parse (parsing), LlamaAgents (deployed document agents), Extract (structured extraction), and Index (ingest and RAG). You can use it with the LlamaIndex framework or standalone.
- Sign up for LlamaParse β Create an account and get your API key.
- Parse β Agentic OCR and document parsing (130+ formats). Docs
- Extract β Structured data extraction from documents. Docs
- Index β Ingest, index, and RAG pipelines. Docs
- Split β Split large documents into subcategories. Docs
- Agents β Build end-to-end document agents with
Workflowsand Agent Builder. Docs
Important Links
π Overview
NOTE: This README is not updated as frequently as the documentation. Please check out the documentation above for the latest updates!
Context
- LLMs are a phenomenal piece of technology for knowledge generation and reasoning. They are pre-trained on large amounts of publicly available data.
- How do we best augment LLMs with our own private data?
We need a comprehensive toolkit to help perform this data augmentation for LLMs.
Proposed Solution
That's where LlamaIndex comes in. LlamaIndex is a "data framework" to help you build LLM apps. It provides the following tools:
- Offers data connectors to ingest your existing data sources and data formats (APIs, PDFs, docs, SQL, etc.).
- Provides ways to structure your data (indices, graphs) so that this data can be easily used with LLMs.
- Provides an advanced retrieval/query interface over your data: Feed in any LLM input prompt, get back retrieved context and knowledge-augmented output.
- Allows easy integrations with your outer application framework (e.g. with LangChain, Flask, Docker, ChatGPT, or anything else).
LlamaIndex provides tools for both beginner users and advanced users. Our high-level API allows beginner users to use LlamaIndex to ingest and query their data in 5 lines of code. Our lower-level APIs allow advanced users to customize and extend any module (data connectors, indices, retrievers, query engines, reranking modules), to fit their needs.
π‘ Contributing
Interested in contributing? Contributions to LlamaIndex core as well as contributing integrations that build on the core are both accepted and highly encouraged! See our Contribution Guide for more details.
New integrations should meaningfully integrate with existing LlamaIndex framework components. At the discretion of LlamaIndex maintainers, some integrations may be declined.
π Documentation
Full documentation can be found here
Please check it out for the most up-to-date tutorials, how-to guides, references, and other resources!
π» Example Usage
# custom selection of integrations to work with core
pipinstallllama-index-core
pipinstallllama-index-llms-openai
pipinstallllama-index-llms-ollama
pipinstallllama-index-embeddings-huggingface
Examples are in the docs/examples folder. Indices are in the indices folder (see list of indices below).
To build a simple vector store index using OpenAI:
importos os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" fromllama_index.coreimport VectorStoreIndex, SimpleDirectoryReader documents = SimpleDirectoryReader("YOUR_DATA_DIRECTORY").load_data() index = VectorStoreIndex.from_documents(documents)
To build a simple vector store index using non-OpenAI LLMs, e.g. LLMs hosted through Ollama:
fromllama_index.coreimport Settings, VectorStoreIndex, SimpleDirectoryReader fromllama_index.embeddings.huggingfaceimport HuggingFaceEmbedding fromllama_index.llms.ollamaimport Ollama fromtransformersimport AutoTokenizer # set the LLM Settings.llm = Ollama( model="llama-3.1:latest", request_timeout=360.0, ) # set tokenizer to match LLM Settings.tokenizer = AutoTokenizer.from_pretrained( "meta-llama/Llama-3.1-8B-Instruct" ) # set the embed model Settings.embed_model = HuggingFaceEmbedding( model_name="BAAI/bge-small-en-v1.5" ) documents = SimpleDirectoryReader("YOUR_DATA_DIRECTORY").load_data() index = VectorStoreIndex.from_documents( documents, )
To query:
query_engine = index.as_query_engine() query_engine.query("YOUR_QUESTION")
By default, data is stored in-memory.
To persist to disk (under ./storage):
index.storage_context.persist()
To reload from disk:
fromllama_index.coreimport StorageContext, load_index_from_storage # rebuild storage context storage_context = StorageContext.from_defaults(persist_dir="./storage") # load index index = load_index_from_storage(storage_context)
A note on Verification of Build Assets
By default, llama-index-core includes a _static folder that contains the nltk and tiktoken cache that is included with the package installation. This ensures that you can easily run llama-index in environments with restrictive disk access permissions at runtime.
To verify that these files are safe and valid, we use the github attest-build-provenance action. This action will verify that the files in the _static folder are the same as the files in the llama-index-core/llama_index/core/_static folder.
To verify this, you can run the following script (pointing to your installed package):
#!/bin/bash STATIC_DIR="venv/lib/python3.13/site-packages/llama_index/core/_static" REPO="run-llama/llama_index" find"$STATIC_DIR"-typef|whileread-rfile;do echo"Verifying: $file" ghattestationverify"$file"-R"$REPO"||echo"Failed to verify: $file" done
π Citation
Reference to cite if you use LlamaIndex in a paper:
@software{Liu_LlamaIndex_2022,
author = {Liu, Jerry},
doi = {10.5281/zenodo.1234},
month = {11},
title = {{LlamaIndex}},
url = {https://github.com/jerryjliu/llama_index},
year = {2022}
}
Project details
Verified details
These details have been verified by PyPIMaintainers
π Avatar for jerryjliu from gravatar.comjerryjliu π Avatar for simonsdsuo from gravatar.com
simonsdsuo
Unverified details
These details have not been verified by PyPIProject links
Meta
-
License Expression: MIT
SPDX License Expression - Author: Jerry Liu
- Maintainer: Andrei Fajardo
- Tags LLM , NLP , RAG , data , devtools , index , retrieval
- Requires: Python <4.0, >=3.10
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index-0.14.22.tar.gz.
File metadata
- Download URL: llama_index-0.14.22.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2c9b31f50d2815abdc191085db4acaf96b7c01851ac66b2e4cc82be8cde589e
|
|
| MD5 |
d09fb0d6f8dcc43f769e1dea1c1b583e
|
|
| BLAKE2b-256 |
28893b6f3318ea2249158daab3ff22777ef5ffa87a63c011659a6cfc55e54c35
|
File details
Details for the file llama_index-0.14.22-py3-none-any.whl.
File metadata
- Download URL: llama_index-0.14.22-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14b4bdd799112062e38288eab6aa16643f29d7532505ab174b0b6d5b0817fe94
|
|
| MD5 |
c4b86250a08da256d5c2588c878e1a74
|
|
| BLAKE2b-256 |
59fdf0837c4ce049d8ece7525bbf64564e93e3f16333856c2a0b47fecb58f317
|
