Skip to main content

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


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

File details

Details for the file llama_index_packs_ollama_query_engine-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_ollama_query_engine-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dd8f1b30559a96ad2ab628fa748ceab41b8bc14a0eb410ac62289c84f1bc6b03
MD5 39eb9d99f90fe40f2d5084de974dd51a
BLAKE2b-256 f92c23c1c12e32c3e424e5991024a89c846bb619be849bd7fa959dbb4f9f6173

See more details on using hashes here.

File details

Details for the file llama_index_packs_ollama_query_engine-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_ollama_query_engine-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a12b11b267072f058c6284164681051d2e3e89c2463f22d8b37f0e237e5e3445
MD5 1bdfac97fdd64d9538605cc0afcb75b0
BLAKE2b-256 0fe5bb60c5ef2a31dedf13d598914131df96bbca8eeae51e72d69f30a868d199

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page