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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ai_dynamo_llm-0.1.0.tar.gz
(5.7 kB
view details)
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 ai_dynamo_llm-0.1.0.tar.gz.
File metadata
- Download URL: ai_dynamo_llm-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0c17e30118be0142a5a80539a0a8e5629d4832cbd3c639a93abcbca9052612b
|
|
| MD5 |
9e8b617d591df80f5743b161d5eb8ade
|
|
| BLAKE2b-256 |
cb134e5dea88e0e6c6bb8f85d18bda75dbd76fb2487c57d20e790f2c840e60bd
|
File details
Details for the file ai_dynamo_llm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_dynamo_llm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
819c14573d7bb8623e3aa86bf511afe07741aa5fa4a4115e923f15038b09e7fb
|
|
| MD5 |
a1bc7dccb5dfd4cf1af4cfadf0968afc
|
|
| BLAKE2b-256 |
c4a759caf4a495a7d6c2b8289681f0745b0415605a13e167ccacab850c0640f7
|