Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keiro_client-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keiro_client-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

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

Hashes for keiro_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fcebfa0bb46b924be94a5dbd01ab629d785f8f87dd7aa521322dcb30a4ec6f57
MD5 e98b4224fe66291289af06db3cd9720a
BLAKE2b-256 9f5d34c71582ae44da162495a8ffab857646c7aa78618361df6fe35c4535cd48

See more details on using hashes here.

Provenance

The following attestation bundles were made for keiro_client-0.1.0.tar.gz:

Publisher: publish.yml on ManasRanjanJena253/Keiro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for keiro_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bbb41c4d436f772419b092780d9a62e65a25220049633416cca5b2bbdefe6cb
MD5 f1a24571eba8265381bd3ca0d06fe7b3
BLAKE2b-256 103d9b7e1b22c194293d79d28f649288d7aff02b1f05d7ee9dc099b9ff723fa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for keiro_client-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ManasRanjanJena253/Keiro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page