Skip to main content

Official Python SDK for TokenBee LLM inference gateway and observability.

Project description

TokenBee Python SDK

Official Python SDK for TokenBee - The Intelligent LLM Inference Gateway with Observability, Compression, and Privacy.

Features

  • Unified API: Access multiple LLM providers (OpenAI, Anthropic, Google, Mistral, etc.) through a single interface.
  • Intelligent Compression: Reduce token usage and latency with context-aware compression.
  • Privacy Guard: Automatic PII masking and privacy-preserving inference.
  • Built-in Observability: Automatic tracking of latency, costs, and token usage.

Installation

pip install tokenbee-sdk

Quick Start

from tokenbee import TokenBee, TokenBeeModel, CompressionRate

# Initialize the client
client = TokenBee(
    api_key="your_api_key_here",
    compression="auto",
    rate=CompressionRate.MEDIUM
)

# Send a request
response = client.send(
    model=TokenBeeModel.OPENAI_GPT_4O,
    input={
        "messages": [
            {"role": "user", "content": "Explain quantum entanglement in simple terms."}
        ]
    }
)

print(response["choices"][0]["message"]["content"])

Advanced Usage

Compression Control

You can specify the compression rate and method per request:

response = client.send(
    model=TokenBeeModel.ANTHROPIC_CLAUDE_3_5_SONNET,
    input={
        "messages": [...],
        "compression": "on",
        "rate": CompressionRate.HIGH,
        "privacy": True
    }
)

Supported Models

The SDK provides a TokenBeeModel enum with popular models:

  • TokenBeeModel.OPENAI_GPT_4O
  • TokenBeeModel.ANTHROPIC_CLAUDE_3_5_SONNET
  • TokenBeeModel.GEMINI_2_0_FLASH
  • ... and many others.

License

MIT

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

tokenbee_sdk-0.2.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

tokenbee_sdk-0.2.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tokenbee_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tokenbee_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a05b3b9551dbed1d260452f1fa8a6b873d3655576c90d7d842103858578a9f87
MD5 54fba85ba9e9b7c346a5f7d541885877
BLAKE2b-256 550e343db7a757dd9654a5270507ea1794b26532e07d017840221fc320826632

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tokenbee_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tokenbee_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6057970d3c022d69ce7e9b633174da55661ec99c4e94041b57a1d74c32f4919a
MD5 19c9fae03bdb063ed6df4c3b3b205ec2
BLAKE2b-256 d33026da558d0cd8603c587e081bcdc281a5bea724744be99b427dc48a680c34

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