Skip to main content

Kayak

Typed AI decisions for Python. Classify text, route requests, rank candidates, and ask structured questions using a local model or a service you operate.

Quickstart · Documentation · Examples · Contributing

Python 3.11+ License: Apache 2.0

Give Kayak text state, named questions, and candidate descriptions. It returns validated answers, the underlying distributions, and model identity. Your application decides how to use the result.

Operation Result
decide with Choice A supplied candidate ID, scores, and relative shares
judge with Choice, Noul, or Score Named typed answers, including binary shares and rubric averages
rank Supplied candidates in score order, with stable ties

The same operations are available on a local Model, Client, and AsyncClient. Optional Laya and Jev adapters use the same named questions while preserving each provider's result semantics.

Quickstart

Kayak 0.4.0 requires Python 3.11+. Install it in your project with uv:

uv add 'kayak==0.4.0'

The base package provides typed values, HTTP clients, and evaluation. Add the local extra for local inference or serve for the HTTP service. See release validation for the tested scope and remaining model and hardware checks.

For the runnable examples below, download and extract the source distribution. It includes the documentation, examples, tests, and validation tools:

cd kayak-0.4.0
uv sync

Check the client integration without a model, service, or accelerator:

uv run -m examples.mock_integration

This command uses a simulated HTTP response. To run actual inference, use a local model or connect to an existing Kayak service as shown below.

Make a local decision

The default model is CLM-v0.1-8B. The first load downloads approximately 16 GB of encoder weights and 76 MB of projection heads. Runtime memory exceeds the weight size; check the hardware guide before loading.

Save this as decide.py in the checkout:

import kayak
from kayak import Choice

questions = {
    "department": Choice(
        instructions="Which team should handle this request?",
        criteria={
            "billing": "Charges, invoices, and refunds",
            "technical": "Bugs and service outages",
        },
    )
}

with kayak.load(device="auto") as model:
    result = model.decide(
        state="I was charged twice for my subscription.",
        questions=questions,
    )

answer = result.answers["department"]
print(answer.choice)
print(answer.probabilities)
print(result.model.fingerprint)
uv run --extra local decide.py

Keep the model context open to reuse the loaded weights. device="auto" selects available CUDA, then MPS, then CPU. Explicit device, precision, cache, and batch settings are described in the API reference.

Serve once, call from your application

Start a service on a machine with sufficient memory:

uv run --extra serve kayak serve --device auto

After loading and a readiness inference, it listens on http://127.0.0.1:8000. In the quickstart program, replace the model context with a client context:

with kayak.Client(base_url="http://127.0.0.1:8000") as client:
    result = client.decide(
        state="I was charged twice for my subscription.",
        questions=questions,
    )

The base client requires no inference libraries. In another Python project, install it with uv add 'kayak==0.4.0'. Async applications use async with kayak.AsyncClient(...) and await the same operations.

The service admits one inference request at a time and returns 503 when busy. Clients make one attempt per call. Configure authentication, TLS at your network boundary, and timeouts using the serving guide.

Use retrieved evidence

Pass your query and retrieved passages as text state, then ask named questions with judge. The RAG decision example shows Choice, Noul, and Score together. Your application owns retrieval and any text generation. RAG evaluation checks recorded retrieval, reranking, context, and answers; the experiment guide covers configuration, repeated runs, and quality gates.

Evaluate the result

CLM scores are scaled cosine similarities. Probabilities are relative shares among the supplied candidates, not calibrated confidence. A candidate is selected even when every option is unsuitable; application thresholds and fallback rules need evaluation against reviewed labels.

Use the evaluation API for your data and the use-case evaluation map for starter datasets and application checks. Hardware validation, numerical conformance, and task quality are separate evidence; their current scope is recorded in the release checklist.

Documentation

The documentation index organizes guides by integration, operation, evaluation, and contribution.

Need Reference
Types, inputs, results, and errors Python API · Typed judgments
Files, pipes, and JSON requests CLI
Service operation and upgrades Serving · Diagnostics · Compatibility
Provider integration Laya and Jev · Migration
Implementation and model behavior Architecture · Model contract
Runnable integrations Examples
Coding assistant context Assistant guide · llms.txt

Contributing

See CONTRIBUTING.md for development setup, checks, bug reports, and pull requests. Code changes follow the engineering conventions.

License

Kayak is licensed under Apache 2.0. It builds on Contrastive Language Models and the Qwen3 encoder. See NOTICE for attribution. Model weights are downloaded separately under their upstream licenses.

Release files for kayak 0.4.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 kayak 0.4.0
File Size Uploaded
kayak-0.4.0.tar.gz 432.9 kB Details

Built distribution (wheel)

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

Total release size: 545.0 kB

Release files / kayak-0.4.0.tar.gz

Download URL kayak-0.4.0.tar.gz
Size 432.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a8027c479119fb37ea0a8daaaae9eefbec3e9fa831e83ba2ce1b0eb327b6b9b5
BLAKE2b-256 checksum
How to use checksums
82740537949137bbc9344e5c1f71d41a3c28750990cbd69b6641c02df487c696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / kayak-0.4.0-py3-none-any.whl

Download URL kayak-0.4.0-py3-none-any.whl
Size 112.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45c8b972d0ca837c9b2eace903fec3d4acec6a87212fa0af55ddf7a58a823c88
BLAKE2b-256 checksum
How to use checksums
12cbe5ea1c31fe358e8fd05901e1bff883a6f3df3646383a020ced7bab569614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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