Skip to main content

pankhllm (Python)

from pankhllm import Client, Chunk

pk = Client("http://localhost:4000")
chunks = [Chunk(text=hit.text, score=hit.score, source=hit.doc_id) for hit in my_retriever.search(q)]

a = pk.ask(q, context=chunks, tags=["private"], prompt="support-agent", max_latency_ms=8000)
print(a.text, a.model, a.cost_usd, a.decision["target_tier"])

for delta in pk.stream(q, context=chunks):
    print(delta, end="")

Already using the openai package? Point it at the router and keep your code:

from openai import OpenAI
client = OpenAI(base_url="http://localhost:4000/v1", api_key="unused",
                default_headers={"X-Pankh-Tags": "private", "X-Pankh-Prompt": "support-agent"})
client.chat.completions.create(model="auto", messages=[...])

Release files for pankhllm 0.1.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 pankhllm 0.1.1
File Size Uploaded
pankhllm-0.1.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pankhllm 0.1.1
File Interpreter ABI Platform
pankhllm-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / pankhllm-0.1.1.tar.gz

Download URL pankhllm-0.1.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cb560d28fa9640c9a3c340c8a1ebbf782fd978694fc74ac30969d4db8ab629d0
BLAKE2b-256 checksum
How to use checksums
0e8c9560023418136989e062b23b4b5ac03f1ecce6399e906714bb376223f07c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pankhllm-0.1.1-py3-none-any.whl

Download URL pankhllm-0.1.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d1f1cbf5f7e2da1eeb4b05c8ac0ad38171ed0887198af6ed7c420e52c13447e
BLAKE2b-256 checksum
How to use checksums
63fa055ac48f8fe7157da093cb05f77b8d33ce5a81b6fad53cc1be941df26894
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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