Python SDK for the ModelBridge API — unified access to multiple AI models
Project description
model-bridge-sdk
Python SDK for the ModelBridge API — unified async access to multiple AI models (Claude, GPT, etc.).
Installation
pip install model-bridge-sdk
Quick Start
import asyncio
from model_bridge_sdk import ModelBridge
async def main():
client = ModelBridge(api_key="your-api-key")
response = await client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=200,
)
print(response["choices"][0]["message"]["content"])
await client.close()
asyncio.run(main())
Streaming
response = await client.chat.completions.create(
model="claude-sonnet-4-6",
stream=True,
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=200,
)
async for chunk in response:
delta = chunk.get("choices", [{}])[0].get("delta", {})
print(delta.get("content") or "", end="", flush=True)
License
MIT
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 modelbridge_python-1.0.0-py3-none-any.whl.
File metadata
- Download URL: modelbridge_python-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60a6ac1ff2d9ca271d3a0389ce9c76cb6a8313e9a066d2500ef111f3d698c7f5
|
|
| MD5 |
f4f9ca11512edf19d9f2dedaa38db91f
|
|
| BLAKE2b-256 |
e58ca8f8f44af5d46e2bf3e8f645093598d0d22a1fcc7ee4d2948360238c29cf
|