Skip to main content

Kave Python SDK - control plane for AI agents

Project description

Kave Python SDK

Install:

uv add kave-sdk
pip install kave-sdk

Quickstart:

from kave import SyncClient
from kave.control.v1 import control_pb2

with SyncClient("localhost:19090", token="kv_...") as kave:
    org = kave.ensure_organization(control_pb2.CreateOrganizationRequest(name="Acme", slug="acme"))
    print(org.id)

Auth

Pass token="..." to add Authorization: Bearer ... on every RPC. Direct proto RPCs are reachable through client.control, client.runtime, and client.audit.

TLS

Use SyncClient(addr="api.example.com:443", tls=True) for system-root TLS, or pass custom grpc.ChannelCredentials with credentials=....

Retry

Idempotent List*, Get*, and Watch* RPCs retry 3 times by default: 200 ms base, 2x exponential backoff, +/-20% jitter, 5 s cap. Mutating RPCs do not retry. Use retry=NO_RETRY or pass a RetryPolicy to customize.

Async

from kave import AsyncClient

async with AsyncClient("localhost:19090") as kave:
    async for agent in kave.aiter_agents(env_id):
        print(agent.name)

Errors

SDK calls wrap gRPC failures in KaveError. Use predicates such as is_not_found(err), is_permission_denied(err), and is_unavailable(err).

Django

Install kave-sdk[django], add kave.contrib.django to INSTALLED_APPS, define KAVE = {...}, and run python manage.py kave_reconcile on deploy.

For multi-tenant Django apps, use kave.contrib.django.UserAgentManager to map each app user to an isolated Kave agent and manage budget updates (set_user_budget, top_up_user_budget, report_usage).

See examples/ and ../CONTRACT.md for the full parity contract.

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

kave_sdk-0.2.0.tar.gz (79.2 kB view details)

Uploaded Source

Built Distribution

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

kave_sdk-0.2.0-py3-none-any.whl (105.6 kB view details)

Uploaded Python 3

File details

Details for the file kave_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: kave_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 79.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kave_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fb7ce29f0dec9ac41aa9e85c00eb157008bf52cf7dd3aa382a256f6f4103a16f
MD5 c401dd35ea07a29a3759b0fcf4fc9b95
BLAKE2b-256 116589e6aa09ed56c92578841d95414d9fedf1ab7aa4cd81fe6cc54199679478

See more details on using hashes here.

File details

Details for the file kave_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: kave_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 105.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kave_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7793b8dc754ad89f4cac82c39c5d288672153437c89faceb4bf39dd4a5862ba2
MD5 01a8b4ed710da27891aae9b671ac2496
BLAKE2b-256 1c68a75eba5710096ef479cdbbcabcb9f32dc7b95fb3b66cc9f8e48e2b7bf0cc

See more details on using hashes here.

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