Skip to main content

llama-index packs zephyr_query_engine integration

Project description

Zephyr Query Engine Pack

Create a query engine using completely local and private models -- HuggingFaceH4/zephyr-7b-beta for the LLM and BAAI/bge-base-en-v1.5 for embeddings.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack ZephyrQueryEnginePack --download-dir ./zephyr_pack

You can then inspect the files at ./zephyr_pack and use them as a template for your own project.

Code Usage

You can download the pack to a the ./zephyr_pack directory:

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
ZephyrQueryEnginePack = download_llama_pack(
    "ZephyrQueryEnginePack", "./zephyr_pack"
)

# You can use any llama-hub loader to get documents!
zephyr_pack = ZephyrQueryEnginePack(documents)

From here, you can use the pack, or inspect and modify the pack in ./zephyr_pack.

The run() function is a light wrapper around index.as_query_engine().query().

response = zephyr_pack.run(
    "What did the author do growing up?", similarity_top_k=2
)

You can also use modules individually.

# Use the llm
llm = zephyr_pack.llm
response = llm.complete("What is HuggingFace?")

# Use the index directly
index = zephyr_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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_packs_zephyr_query_engine-0.5.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_zephyr_query_engine-0.5.1.tar.gz
Algorithm Hash digest
SHA256 dc0893386501ba64c2f96d02914981a297447684ca6b5d5ba45a1b0e80934774
MD5 715fd9975a29f9237175abd61424168d
BLAKE2b-256 e59bb4b8c2a5b438d15b3da6232eacbca88aaaced6cf9d3965363299fc0dee37

See more details on using hashes here.

File details

Details for the file llama_index_packs_zephyr_query_engine-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_zephyr_query_engine-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea5d97ee38f1e36c0a306228edcbc91f382c4f5344d830b96df95d7875e91df2
MD5 8754930e3c4d4817efb76ab34e48bf6f
BLAKE2b-256 6975db6d6d6501101a458902f223fdb5b33f824c93fd387d77b0b1316fa2c462

See more details on using hashes here.

Supported by

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