Aisberg Python SDK
Aisberg SDK for Python is a robust and easy-to-use library for interacting with the Aisberg API.
It provides synchronous and asynchronous clients, advanced module abstractions, and built-in support for
conversational LLM workflows, collections, embeddings, and more.
Features
- Sync & Async clients: Use with regular scripts or async frameworks
- Auto tool execution for LLM flows (tool calls, results integration)
- Modular architecture: Collections, chat, models, workflows, embeddings, and more
- Strong typing via Pydantic models
- Environment-based configuration (supports
.envfiles and system environment variables) - Context manager support for easy resource management
- Custom tool registration: Easily extend LLM capabilities with your own functions
- Document Parsing: Parse documents into structured data (e.g., JSON, CSV, PNG, PDF, etc.)
Installation
pip install aisberg
Or, for local development:
git clone https://your.git.repo/aisberg.git
cd aisberg
pip install -e .
Quickstart
1. Configure your API key and base URL
You can set them as environment variables, or in a .env file:
AISBERG_API_KEY=...
AISBERG_BASE_URL=https://url
AISBERG_TIMEOUT=... # Optional, default is 180 seconds (3 minutes)
2. Synchronous Usage
from aisberg import AisbergClient
with AisbergClient() as client:
me = client.me.info()
print(me)
chat_response = client.chat.complete(
input="Bonjour, qui es-tu ?",
model="llm-aisberg",
)
print(chat_response.choices[0].message.content)
3. Asynchronous Usage
import asyncio
from aisberg import AisbergAsyncClient
async def main():
async with AisbergAsyncClient() as client:
await client.initialize()
me = await client.me.info()
print(me)
chat_response = await client.chat.complete(
input="Hello, who are you?",
model="llm-aisberg",
)
print(chat_response.choices[0].message.content)
asyncio.run(main())
Modules
client.me— User/account infoclient.chat— Conversational LLM completions and streamingclient.collections— Manage data collectionsclient.embeddings— Encode texts to embeddingsclient.models— Model discovery & infoclient.workflows— Workflow management & executionclient.tools— Register and execute tools for LLM tool callsclient.documents— Document parsing and management
Each module is available both in the sync and async clients with similar APIs.
Tool Calls and Automatic Execution
The SDK supports tool-augmented LLM workflows. Register your own functions for use in chat:
def my_tool(args):
# Custom business logic
return {"result": "tool output"}
client.tools.register("my_tool", my_tool)
response = client.chat.complete(
input="Use the tool please.",
model="llm-aisberg",
tools=[{"name": "my_tool", ...}],
auto_execute_tools=True,
)
Advanced Usage
Custom Configuration
You can override configuration when instantiating the client:
client = AisbergClient(
api_key="...",
base_url="https://url",
timeout=60,
)
Environment Variables Supported
AISBERG_API_KEYAISBERG_BASE_URLAISBERG_TIMEOUT(optional)
Using in a Context Manager
Both clients are context manager compatible:
with AisbergClient() as client:
# Sync usage
...
async with AisbergAsyncClient() as client:
# Async usage
...
License
Private License — Not for public distribution or resale.
For enterprise/commercial use, please contact Mathis Lambert or Free Pro.
Authors
- Mathis Lambert
- Free Pro
Support
For support, bug reports, or feature requests, please contact your technical representative.
Metadata
Release files for aisberg 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aisberg-0.4.4.tar.gz | 30.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aisberg-0.4.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.9 kB
Release files / aisberg-0.4.4.tar.gz
| Download URL | aisberg-0.4.4.tar.gz |
|---|---|
| Size | 30.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
584cff22cb27668fa0f258464c1275ab614b0be97329bee0c87d6404fed7dd62
|
|
BLAKE2b-256 checksum How to use checksums |
2804d41e98e59d13557363ca5000937ac59517bb133f7a65b58081004c742105
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / aisberg-0.4.4-py3-none-any.whl
| Download URL | aisberg-0.4.4-py3-none-any.whl |
|---|---|
| Size | 39.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
571432ae57d69396789be9b59da9b3176d407795ffbaeb660ed3817727dede07
|
|
BLAKE2b-256 checksum How to use checksums |
5e9a40566055a4521593a3d4a9d6bfd855a49db26523736388caf7a9ad3a80ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|