Skip to main content

Keiro

Python client and command-line interface for the Keiro eb1 API.

Install

Keiro requires Python 3.11 or later.

python -m pip install keiro

Quickstart

Configure your API credentials:

keiro setup

Then send a prompt:

from keiro import models

answer = models("eb1-preview", "What is machine learning?")
print(answer)

Models

Model Description
eb1-preview Balanced default for general-purpose reasoning and coding.
eb1-frontier-preview Highest-capability option for complex tasks.
eb1-fast-preview Lower-latency option for interactive work.
eb1-efficient-preview Cost-efficient option for routine and high-volume work.

Prompt-first API

The models facade returns text directly for the common case:

from keiro import models

answer = models("eb1-preview", "Explain dependency injection with a short example.")
print(answer)

Use models.response() when you also need response metadata:

from keiro import models

response = models.response("eb1-preview", "Summarize the benefits of type hints.")
print(response.text)
print(response.usage)

Create a reusable binding when several prompts share the same model and parameters:

from keiro import models

concise = models.instance("eb1-fast-preview", max_tokens=200)
print(concise("Explain immutable data."))
print(concise("Explain idempotency."))

Stream text as it arrives:

from keiro import models

for chunk in models.stream("eb1-preview", "Draft a concise project update."):
    print(chunk, end="", flush=True)

Call models.close() when a long-running process is finished with the shared client connection.

CLI usage

Run an interactive session:

keiro

Send a one-shot prompt or select a model:

keiro "Explain semantic versioning."
keiro -m eb1-fast-preview "Summarize this text."

Pipe context from another command:

git diff | keiro "Review this change for correctness."

List the models available to your account or open the browser client:

keiro models
keiro gui

Run keiro --help for the complete command reference.

Configuration

keiro setup validates your API key and saves the client configuration under ~/.keiro/. Run it again whenever you need to replace your credentials.

For programmatic configuration, pass credentials directly to Client:

from keiro import Client

with Client(
    api_key="your-api-key",
    base_url="https://api.keirolabs.ai/v1",
) as client:
    response = client.chat(
        messages=[{"role": "user", "content": "Explain binary search."}],
        model="eb1-preview",
    )
    print(response["choices"][0]["message"]["content"])

Explicit Client arguments take precedence over saved configuration.

Requirements

  • Python 3.11, 3.12, or 3.13
  • A Keiro API key
  • Network access to the Keiro API

Metadata

Release files for keiro 0.12.24

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

Source distribution (sdist)

Source distribution for keiro 0.12.24
File Size Uploaded Provenance Actions
keiro-0.12.24.tar.gz 160.8 kB Without provenance Details for keiro-0.12.24.tar.gz

Built distribution (wheel)

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

Total release size: 341.2 kB

Release files / keiro-0.12.24.tar.gz

Download URL keiro-0.12.24.tar.gz
Size 160.8 kB
Tags Source
SHA-256 checksum
How to use checksums
70149892d5dacffa9ab8f5d0e3383df386e2fc51e088c8b5a402242a7c671ab9
BLAKE2b-256 checksum
How to use checksums
49ef8796681ae0f3c5ecb4e28b85fdfbf69a29bda0dd2e6ba8cc8c3ec82fa33d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / keiro-0.12.24-py3-none-any.whl

Download URL keiro-0.12.24-py3-none-any.whl
Size 180.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e97d35c8596208b228b95488aad858d82ae5b4261b8f422424815b971c03175b
BLAKE2b-256 checksum
How to use checksums
c021a0c3eced221fc5ccd65e29dc6ce5524cf317d550f90805c01c0594679863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Security for keiro 0.12.24

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.

Release history Release notifications | RSS feed

This release

0.12.24 This release

2 release files No provenance

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