Metadata-Version: 2.5
Name: pankhllm
Version: 0.1.1
Summary: Client for pankhllm, the LLM gateway that learns to skip the LLM.
Project-URL: Homepage, https://singhpratech.github.io/pankhllm/
Project-URL: Repository, https://github.com/singhpratech/pankhllm
Project-URL: Documentation, https://github.com/singhpratech/pankhllm/blob/main/docs/TRAINING.md
License: MIT
Keywords: agents,gateway,llm,openai,router
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# pankhllm (Python)

```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:

```python
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=[...])
```
