Python SDK for Kestrel — route LLM requests to the cheapest capable model
Project description
Kestrel Python SDK
Drop-in LLM cost optimization. Route requests to the cheapest capable model with one line of code.
Install
pip install kestrel-sdk
Usage
import kestrel_sdk
client = kestrel_sdk.Client(
api_key="ks-your-kestrel-key",
provider_key="sk-your-openai-key",
base_url="http://localhost:8080/v1",
)
# Send requests as usual — Kestrel handles routing
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "What is 2+2?"}],
)
The SDK is a thin wrapper over the OpenAI Python SDK. All openai.OpenAI methods work as expected.
Async
import kestrel_sdk
client = kestrel_sdk.AsyncClient(
api_key="ks-your-key",
provider_key="sk-your-openai-key",
)
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
Learn More
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 kestrel_sdk-0.1.0.tar.gz.
File metadata
- Download URL: kestrel_sdk-0.1.0.tar.gz
- Upload date:
- Size: 36.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33cdc1ba4d743fdba519d839d9af01929b2652edde2453660f1dd7e39a95fb16
|
|
| MD5 |
ee89867b7f9cac4dece675b15ea36435
|
|
| BLAKE2b-256 |
bf3cf5003362e2fbc3d75d9be77091968d7e33d07aeba6e5caeecd01e5056271
|
Provenance
The following attestation bundles were made for kestrel_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on andber6/kestrel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kestrel_sdk-0.1.0.tar.gz -
Subject digest:
33cdc1ba4d743fdba519d839d9af01929b2652edde2453660f1dd7e39a95fb16 - Sigstore transparency entry: 1200224974
- Sigstore integration time:
-
Permalink:
andber6/kestrel@3f3410f4e84fe4c9f639ed6fb7fa9f3211b36117 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/andber6
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f3410f4e84fe4c9f639ed6fb7fa9f3211b36117 -
Trigger Event:
release
-
Statement type:
File details
Details for the file kestrel_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kestrel_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95f701d84f561b9ea8373e000abeae7ec789f667afea1b072fb7848e961dffc8
|
|
| MD5 |
2d955596e4a7282088c3e347ab89473e
|
|
| BLAKE2b-256 |
6f74c9c8ef938f0f9b1cf10f7d0b83c8cded369e49965d1e48d3a17811b3026f
|
Provenance
The following attestation bundles were made for kestrel_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on andber6/kestrel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kestrel_sdk-0.1.0-py3-none-any.whl -
Subject digest:
95f701d84f561b9ea8373e000abeae7ec789f667afea1b072fb7848e961dffc8 - Sigstore transparency entry: 1200224999
- Sigstore integration time:
-
Permalink:
andber6/kestrel@3f3410f4e84fe4c9f639ed6fb7fa9f3211b36117 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/andber6
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f3410f4e84fe4c9f639ed6fb7fa9f3211b36117 -
Trigger Event:
release
-
Statement type: