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()
retriver = 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
Close
Hashes for llama_index_packs_ollama_query_engine-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9c258d1ece62f40bc3cbce21c137d58f9174b7a3c290e90bbab7a698a1f1207 |
|
MD5 | b0676e979fff2f58e54dcbfb5198553b |
|
BLAKE2b-256 | 792bdb3d44d205a41f0634c9249a9736801ca61d5de1d55ca952b128ac886765 |
Close
Hashes for llama_index_packs_ollama_query_engine-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2733e511e06648b452c3880e03293b9160f82b38a4738fbdfd3b28fbd3c176be |
|
MD5 | 0c5739c007154437a8fabd666179e884 |
|
BLAKE2b-256 | 96c7fc24601cf2beb7cd3e21fbf8df114de36d2f55394754c678710d7ab3e74f |