Lightweight Python SDK for Edgee AI Gateway
Project description
Edgee Python SDK
Lightweight, type-safe Python SDK for the Edgee AI Gateway.
Installation
pip install edgee
Quick Start
from edgee import Edgee
edgee = Edgee("your-api-key")
# Send a simple request
response = edgee.send(
model="anthropic/claude-haiku-4-5",
input="What is the capital of France?"
)
print(response.text)
# "The capital of France is Paris."
Send Method
The send() method makes non-streaming chat completion requests:
response = edgee.send(
model="anthropic/claude-haiku-4-5",
input="Hello, world!"
)
# Access response
print(response.text) # Text content
print(response.finish_reason) # Finish reason
print(response.tool_calls) # Tool calls (if any)
# Access usage and compression info
if response.usage:
print(f"Tokens used: {response.usage.total_tokens}")
if response.compression:
print(f"Saved tokens: {response.compression.saved_tokens}")
print(f"Reduction: {response.compression.reduction}%")
print(f"Cost savings: ${response.compression.cost_savings / 1_000_000:.3f}")
print(f"Time: {response.compression.time_ms} ms")
Stream Method
The stream() method enables real-time streaming responses:
for chunk in edgee.stream("anthropic/claude-haiku-4-5", "Tell me a story"):
if chunk.text:
print(chunk.text, end="", flush=True)
if chunk.finish_reason:
print(f"\nFinished: {chunk.finish_reason}")
Features
- ✅ Type-safe - Full type hints with dataclasses
- ✅ OpenAI-compatible - Works with any model supported by Edgee
- ✅ Streaming - Real-time response streaming with generators
- ✅ Tool calling - Full support for function calling
- ✅ Flexible input - Accept strings, dicts, or InputObject
- ✅ Compression info - Access token compression metrics in responses
- ✅ Zero dependencies - Uses only Python standard library
Documentation
For complete documentation, examples, and API reference, visit:
👉 Official Python SDK Documentation
The documentation includes:
- Configuration guide - Multiple ways to configure the SDK
- Send method - Complete guide to non-streaming requests
- Stream method - Streaming responses guide
- Tools - Function calling guide
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
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
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 edgee-1.0.4.tar.gz.
File metadata
- Download URL: edgee-1.0.4.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92e3474917b62067cd065133fba261f686b36c4febe86c27859cf9bcef867fed
|
|
| MD5 |
65384c826aff05e7ca4db5466c5411e8
|
|
| BLAKE2b-256 |
29cbd443c8ab26a4ea6d4c1b9a2abd878b156ead032547ea4fc7af2dbdaaa156
|
Provenance
The following attestation bundles were made for edgee-1.0.4.tar.gz:
Publisher:
release.yml on edgee-ai/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgee-1.0.4.tar.gz -
Subject digest:
92e3474917b62067cd065133fba261f686b36c4febe86c27859cf9bcef867fed - Sigstore transparency entry: 1576923971
- Sigstore integration time:
-
Permalink:
edgee-ai/python-sdk@1ff6bdd4dca9775ae5f0f6fb12233c67c07c8031 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/edgee-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ff6bdd4dca9775ae5f0f6fb12233c67c07c8031 -
Trigger Event:
push
-
Statement type:
File details
Details for the file edgee-1.0.4-py3-none-any.whl.
File metadata
- Download URL: edgee-1.0.4-py3-none-any.whl
- Upload date:
- Size: 9.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 |
a49f5fdf541c142813ff8b0fbee67da2d73cd11272803e7b2793fafdea909d2e
|
|
| MD5 |
18a98cc0954d4a9a2b60bbd01605fa80
|
|
| BLAKE2b-256 |
755b6487a82871794f6161961f97dbfda331180516017a2321acc63cdf231e11
|
Provenance
The following attestation bundles were made for edgee-1.0.4-py3-none-any.whl:
Publisher:
release.yml on edgee-ai/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgee-1.0.4-py3-none-any.whl -
Subject digest:
a49f5fdf541c142813ff8b0fbee67da2d73cd11272803e7b2793fafdea909d2e - Sigstore transparency entry: 1576924262
- Sigstore integration time:
-
Permalink:
edgee-ai/python-sdk@1ff6bdd4dca9775ae5f0f6fb12233c67c07c8031 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/edgee-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ff6bdd4dca9775ae5f0f6fb12233c67c07c8031 -
Trigger Event:
push
-
Statement type: