Python client SDK for Keiro — self-hostable adaptive RAG infrastructure
Project description
keiro-client
Python client SDK for Keiro — a self-hostable adaptive RAG infrastructure.
Installation
pip install keiro-client
Quickstart
from keiro import KeiroClient
client = KeiroClient(
base_url="http://localhost:8080",
secret="your-shared-secret",
namespace="my-docs"
)
# Ingest a document
job_id = client.ingest("document.pdf")
# Poll until complete
while True:
status = client.job_status(job_id)
if status.is_terminal:
break
# Query
response = client.query("What are the main compliance obligations?")
print(response.response)
print(f"Strategy used: {response.retrieval_details.tier_name}")
print(f"Cache hit: {response.cache_hit}")
print(f"Total tokens: {response.total_tokens}")
Configuration
| Parameter | Description |
|---|---|
base_url |
URL of your Keiro gateway, e.g. http://localhost:8080 |
secret |
Shared secret set in KEIRO_SECRET env var |
namespace |
Namespace identifier scoping all operations |
timeout |
Request timeout in seconds (default 120) |
Exception Handling
from keiro import (
KeiroClient,
AuthenticationError,
RateLimitError,
IngestionError,
ConnectionError,
)
try:
response = client.query("What is the refund policy?")
except AuthenticationError:
print("Invalid secret")
except RateLimitError as e:
print(f"Rate limited — retry after {e.retry_after}s")
except ConnectionError:
print("Gateway unreachable")
Links
Project details
Release history Release notifications | RSS feed
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_client-0.1.0.tar.gz.
File metadata
- Download URL: keiro_client-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcebfa0bb46b924be94a5dbd01ab629d785f8f87dd7aa521322dcb30a4ec6f57
|
|
| MD5 |
e98b4224fe66291289af06db3cd9720a
|
|
| BLAKE2b-256 |
9f5d34c71582ae44da162495a8ffab857646c7aa78618361df6fe35c4535cd48
|
Provenance
The following attestation bundles were made for keiro_client-0.1.0.tar.gz:
Publisher:
publish.yml on ManasRanjanJena253/Keiro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keiro_client-0.1.0.tar.gz -
Subject digest:
fcebfa0bb46b924be94a5dbd01ab629d785f8f87dd7aa521322dcb30a4ec6f57 - Sigstore transparency entry: 1741439618
- Sigstore integration time:
-
Permalink:
ManasRanjanJena253/Keiro@5d0dc7476967ef9856e45291b10a113d027c82e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ManasRanjanJena253
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5d0dc7476967ef9856e45291b10a113d027c82e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file keiro_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keiro_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bbb41c4d436f772419b092780d9a62e65a25220049633416cca5b2bbdefe6cb
|
|
| MD5 |
f1a24571eba8265381bd3ca0d06fe7b3
|
|
| BLAKE2b-256 |
103d9b7e1b22c194293d79d28f649288d7aff02b1f05d7ee9dc099b9ff723fa4
|
Provenance
The following attestation bundles were made for keiro_client-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ManasRanjanJena253/Keiro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keiro_client-0.1.0-py3-none-any.whl -
Subject digest:
5bbb41c4d436f772419b092780d9a62e65a25220049633416cca5b2bbdefe6cb - Sigstore transparency entry: 1741439660
- Sigstore integration time:
-
Permalink:
ManasRanjanJena253/Keiro@5d0dc7476967ef9856e45291b10a113d027c82e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ManasRanjanJena253
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5d0dc7476967ef9856e45291b10a113d027c82e1 -
Trigger Event:
push
-
Statement type: