ai-dynamo-llm
OpenAI-compatible inference client with multimodal support, designed for NVIDIA Dynamo-style serving stacks.
Features
- Chat completions (streaming and non-streaming) against any OpenAI-compatible endpoint
- Multimodal messages: attach images by file path or URL (base64 data-URI encoding)
- Text embeddings
- Automatic retry with backoff on 429 / 5xx / connection errors
- Token estimation with CJK-aware budgeting
Install
pip install ai-dynamo-llm
Quick start
from ai_dynamo_llm import AIDynamoClient, ChatMessage
client = AIDynamoClient(api_key="sk-...", base_url="http://localhost:8000/v1")
resp = client.chat(
model="dynamo-llm",
messages=[
ChatMessage.system("You are a helpful assistant."),
ChatMessage.user("What is Dynamo?"),
],
)
print(resp["choices"][0]["message"]["content"])
Multimodal
msg = ChatMessage.multimodal(
"Describe this image.",
["/tmp/screenshot.png", "https://example.com/diagram.png"],
)
resp = client.chat(model="dynamo-vlm", messages=[msg])
Token budgeting
from ai_dynamo_llm import estimate_tokens, truncate_to_tokens
assert estimate_tokens("hello world") <= estimate_tokens("你好世界" * 10)
prompt = truncate_to_tokens(long_doc, max_tokens=2048)
License
Apache-2.0
Metadata
Release files for ai-dynamo-llm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ai_dynamo_llm-0.1.0.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ai_dynamo_llm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / ai_dynamo_llm-0.1.0.tar.gz
| Download URL | ai_dynamo_llm-0.1.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0c17e30118be0142a5a80539a0a8e5629d4832cbd3c639a93abcbca9052612b
|
|
BLAKE2b-256 checksum How to use checksums |
cb134e5dea88e0e6c6bb8f85d18bda75dbd76fb2487c57d20e790f2c840e60bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / ai_dynamo_llm-0.1.0-py3-none-any.whl
| Download URL | ai_dynamo_llm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
819c14573d7bb8623e3aa86bf511afe07741aa5fa4a4115e923f15038b09e7fb
|
|
BLAKE2b-256 checksum How to use checksums |
c4a759caf4a495a7d6c2b8289681f0745b0415605a13e167ccacab850c0640f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|