Skip to main content

Kytchen Python SDK

Python client for Kytchen - BYOLLM Context Orchestration.

Installation

pip install kytchen

Quick Start

import asyncio
from kytchen_sdk import KytchenClient, Budget

async def main():
    # Initialize client
    client = KytchenClient(
        api_key="kyt_sk_...",
        base_url="http://localhost:8000",  # For self-hosted
    )

    # Upload a dataset
    dataset = await client.datasets.create("my-data", "document.txt")

    # Query with your own LLM key (BYOLLM)
    result = await client.query(
        query="What is the main topic?",
        dataset_ids=[dataset.id],
        provider="anthropic",
        provider_api_key="sk-ant-...",  # Your Anthropic key
        budget=Budget(max_iterations=10, max_cost_usd=0.50),
    )

    print(result.answer)

    await client.close()

asyncio.run(main())

Features

  • Async-first: Built on httpx for efficient async HTTP
  • BYOLLM: Bring your own LLM API key (Anthropic, OpenAI)
  • Streaming: Real-time query progress via SSE
  • Self-host ready: Works with Docker self-hosted instances
  • Type-safe: Full type hints and dataclasses

API Reference

KytchenClient

client = KytchenClient(
    api_key="kyt_sk_...",
    base_url="https://api.kytchen.dev",  # Optional
    timeout=60.0,  # Optional
)

Datasets

# Upload
dataset = await client.datasets.create("name", "path/to/file.txt")

# List
datasets = await client.datasets.list()

# Get
dataset = await client.datasets.get("dataset-id")

# Delete
await client.datasets.delete("dataset-id")

Query

# Standard query
result = await client.query(
    query="Your question",
    dataset_ids=["id1", "id2"],
    budget=Budget(max_cost_usd=0.50),
    provider="anthropic",
    provider_api_key="your-llm-key",
)

# Streaming query
async for event in client.query_stream(...):
    print(event.type, event.data)

Self-Hosting

For self-hosted Kytchen instances:

client = KytchenClient(
    api_key="kyt_sk_selfhost_dev_key_12345",
    base_url="http://localhost:8000",
)

See the Docker self-host guide for setup instructions.

License

MIT

Metadata

Release files for kytchen-sdk 1.0.0

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

Source distribution (sdist)

Source distribution for kytchen-sdk 1.0.0
File Size Uploaded
kytchen_sdk-1.0.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kytchen-sdk 1.0.0
File Interpreter ABI Platform
kytchen_sdk-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / kytchen_sdk-1.0.0.tar.gz

Download URL kytchen_sdk-1.0.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
68acc0d6a87a1630ceaeb481885de761dc85b01c31ced3902daac2e4af0c96ad
BLAKE2b-256 checksum
How to use checksums
0e418feba669b9c1aa3de0ccf7138b4669209c41a50f338a28f0aa5f2de75d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / kytchen_sdk-1.0.0-py3-none-any.whl

Download URL kytchen_sdk-1.0.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc3c14f4e7e0f5a4719f7dce32efb4f452a4d1c4369431aeba6c544624d8ed31
BLAKE2b-256 checksum
How to use checksums
7c4ba6d293773f1b5663e5c53c341a450ad21938063933928c407e81dd601f74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

1.0.0 This release

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