llama-index packs ollama_query_engine integration
Project description
Ollama Query Engine Pack
Create a query engine using completely local by Ollama
CLI Usage
You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:
llamaindex-cli download-llamapack OllamaQueryEnginePack --download-dir ./ollama_pack
You can then inspect the files at ./ollama_pack and use them as a template for your own project.
Code Usage
You can download the pack to a the ./ollama_pack directory:
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
OllamaQueryEnginePack = download_llama_pack(
"OllamaQueryEnginePack", "./ollama_pack"
)
# You can use any llama-hub loader to get documents!
ollama_pack = OllamaQueryEnginePack(model="llama2", documents=documents)
From here, you can use the pack, or inspect and modify the pack in ./ollama_pack.
The run() function is a light wrapper around index.as_query_engine().query().
response = ollama_pack.run("What is the title of the book of John?")
You can also use modules individually.
# Use the llm
llm = ollama_pack.llm
response = llm.complete("What is Ollama?")
# Use the index directly
index = ollama_pack.index
query_engine = index.as_query_engine()
retriever = index.as_retriever()
Project details
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_packs_ollama_query_engine-0.6.0.tar.gz.
File metadata
- Download URL: llama_index_packs_ollama_query_engine-0.6.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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 |
45a8f8f7c512ae80003037f04f540dd5a2856ee1beb720a26dfdb343c5bab891
|
|
| MD5 |
e5852945ae7d42df8e12beba63066c26
|
|
| BLAKE2b-256 |
67f26d480e02e8007858a3c9f869843a646f7ea99e1cc514f3cc94cf7d9c5513
|
File details
Details for the file llama_index_packs_ollama_query_engine-0.6.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_packs_ollama_query_engine-0.6.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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 |
5cb04f05abb12fef0e03d03670d5df1ee59ebd7f646406ffdf9350ec7b66c1e7
|
|
| MD5 |
f6964798e87a9140deed9199adac1f51
|
|
| BLAKE2b-256 |
51811f98ac4a83513cbec789d7eea0a24d81106740aea8cfea4a0d2cb35f03cd
|