Skip to main content

Arize-Phoenix LlamaPack

This LlamaPack instruments your LlamaIndex app for LLM tracing with Phoenix, an open-source LLM observability library from Arize AI.

CLI Usage

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

llamaindex-cli download-llamapack ArizePhoenixQueryEnginePack --download-dir ./arize_pack

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

Code Usage

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

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
ArizePhoenixQueryEnginePack = download_llama_pack(
    "ArizePhoenixQueryEnginePack", "./arize_pack"
)

You can then inspect the files at ./arize_pack or continue on to use the module.

import os

from llama_index.core.node_parser import SentenceSplitter
from llama_index.readers.web import SimpleWebPageReader
from tqdm.auto import tqdm

Configure your OpenAI API key.

os.environ["OPENAI_API_KEY"] = "copy-your-openai-api-key-here"

Parse your documents into a list of nodes and pass to your LlamaPack. In this example, use nodes from a Paul Graham essay as input.

documents = SimpleWebPageReader().load_data(
    [
        "https://raw.githubusercontent.com/jerryjliu/llama_index/adb054429f642cc7bbfcb66d4c232e072325eeab/examples/paul_graham_essay/data/paul_graham_essay.txt"
    ]
)
parser = SentenceSplitter()
nodes = parser.get_nodes_from_documents(documents)
phoenix_pack = ArizePhoenixQueryEnginePack(nodes=nodes)

Run a set of queries via the pack's run method, which delegates to the underlying query engine.

queries = [
    "What did Paul Graham do growing up?",
    "When and how did Paul Graham's mother die?",
    "What, in Paul Graham's opinion, is the most distinctive thing about YC?",
    "When and how did Paul Graham meet Jessica Livingston?",
    "What is Bel, and when and where was it written?",
]
for query in tqdm(queries):
    print("Query")
    print("=====")
    print(query)
    print()
    response = phoenix_pack.run(query)
    print("Response")
    print("========")
    print(response)
    print()

View your trace data in the Phoenix UI.

phoenix_session_url = phoenix_pack.get_modules()["session_url"]
print(f"Open the Phoenix UI to view your trace data: {phoenix_session_url}")

You can access the internals of the LlamaPack, including your Phoenix session and your query engine, via the get_modules method.

phoenix_pack.get_modules()

Check out the Phoenix documentation for more information!

Metadata

Release files for llama-index-packs-arize-phoenix-query-engine 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-packs-arize-phoenix-query-engine 0.4.1
File Size Uploaded Provenance Actions
llama_index_packs_arize_phoenix_query_engine-0.4.1.tar.gz 16.6 kB Without provenance Details for llama_index_packs_arize_phoenix_query_engine-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-packs-arize-phoenix-query-engine 0.4.1
File Interpreter ABI Platform Actions
llama_index_packs_arize_phoenix_query_engine-0.4.1-py3-none-any.whl Python 3 none any Details for llama_index_packs_arize_phoenix_query_engine-0.4.1-py3-none-any.whl

Total release size: 32.9 kB

Release files / llama_index_packs_arize_phoenix_query_engine-0.4.1.tar.gz

Download URL llama_index_packs_arize_phoenix_query_engine-0.4.1.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aab98df12b571afa42ce8d5fa119fea94d21674b002be6e731abe8514c789cfb
BLAKE2b-256 checksum
How to use checksums
63d3eeb61d3b6a6a6ab9bf356471a89d9f09a4d4ec9e478c4dc4df7c60e98178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release files / llama_index_packs_arize_phoenix_query_engine-0.4.1-py3-none-any.whl

Download URL llama_index_packs_arize_phoenix_query_engine-0.4.1-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d73144f0c93a6f627d1fc968461a44e1a453ea56e42cee96a57229d84e4fc30
BLAKE2b-256 checksum
How to use checksums
0911ffa31c873e61d787c6cba3b3daa572baa2ae944913f0a1be1208cd99614d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Security for llama-index-packs-arize-phoenix-query-engine 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page