Skip to main content

Lightweight Python SDK for Edgee AI Gateway

Project description

Edgee Python SDK

Lightweight, type-safe Python SDK for the Edgee AI Gateway.

PyPI version License

Installation

pip install edgee

Quick Start

from edgee import Edgee

edgee = Edgee("your-api-key")

# Send a simple request
response = edgee.send(
    model="gpt-4o",
    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="gpt-4o",
    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"Input tokens: {response.compression.input_tokens}")
    print(f"Saved tokens: {response.compression.saved_tokens}")
    print(f"Compression rate: {response.compression.rate}")

Stream Method

The stream() method enables real-time streaming responses:

for chunk in edgee.stream("gpt-4o", "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:

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

edgee-1.0.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

edgee-1.0.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file edgee-1.0.1.tar.gz.

File metadata

  • Download URL: edgee-1.0.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edgee-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cb805ce4e9f30f74e68117c67c0c4dce8d0cf2fa7e95a344cd5c04f0465dc5fd
MD5 05b93ca5cc1ffdc21e4dfa445bcab6e2
BLAKE2b-256 fa19a5af567e4a00e9e6c118db97c4762bc149ae6fd17e88c03cd8f05a5832cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgee-1.0.1.tar.gz:

Publisher: release.yml on edgee-ai/python-sdk

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

File details

Details for the file edgee-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: edgee-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edgee-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c74aaf4a4a7dec3eee2a94774f71e7b475286f6b4ac5715f79e3b59de1b0652b
MD5 2d6da46aec0e72414bdbea1c6fa8a090
BLAKE2b-256 1d0f17893276ab7b3f3933690c5657ed4995f74278d69e0a363583840343c341

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgee-1.0.1-py3-none-any.whl:

Publisher: release.yml on edgee-ai/python-sdk

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