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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keiro-0.12.24.tar.gz.
File metadata
- Download URL: keiro-0.12.24.tar.gz
- Upload date:
- Size: 160.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70149892d5dacffa9ab8f5d0e3383df386e2fc51e088c8b5a402242a7c671ab9
|
|
| MD5 |
fd2f2bf9d281d093e9bf823365dc273b
|
|
| BLAKE2b-256 |
49ef8796681ae0f3c5ecb4e28b85fdfbf69a29bda0dd2e6ba8cc8c3ec82fa33d
|
File details
Details for the file keiro-0.12.24-py3-none-any.whl.
File metadata
- Download URL: keiro-0.12.24-py3-none-any.whl
- Upload date:
- Size: 180.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e97d35c8596208b228b95488aad858d82ae5b4261b8f422424815b971c03175b
|
|
| MD5 |
a851e7a28041386a0bd4c7b0740151c0
|
|
| BLAKE2b-256 |
c021a0c3eced221fc5ccd65e29dc6ce5524cf317d550f90805c01c0594679863
|