A lightweight, model-agnostic LLM provider abstraction with streaming and tool support
Project description
voxagent
A lightweight, model-agnostic LLM provider abstraction with streaming and tool support.
Features
- Multi-Provider: Unified interface for OpenAI, Anthropic, Google, Groq, Ollama
- Streaming: Typed
StreamChunkunion (TextDelta, ToolUse, MessageEnd, Error) - Tool System:
@tooldecorator for easy function-to-tool conversion - MCP Integration: First-class Model Context Protocol support
- Type Safe: Full type hints with
py.typedmarker - Minimal Dependencies: Core requires only
pydantic,httpx,anyio
Installation
# Core only (no provider SDKs)
pip install voxagent
# With specific providers
pip install voxagent[openai]
pip install voxagent[anthropic]
pip install voxagent[google]
pip install voxagent[ollama]
# All providers
pip install voxagent[all]
Quick Start
import asyncio
from voxagent import Agent
async def main():
agent = Agent(model="openai:gpt-4o")
result = await agent.run("Hello, world!")
print(result.output)
asyncio.run(main())
Streaming
from voxagent import Agent
from voxagent.providers import TextDeltaChunk
agent = Agent(model="anthropic:claude-3-5-sonnet")
async for chunk in agent.stream("Tell me a story"):
if isinstance(chunk, TextDeltaChunk):
print(chunk.delta, end="", flush=True)
Tools
from voxagent import Agent
from voxagent.tools import tool
@tool()
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
return f"Sunny, 72°F in {city}"
agent = Agent(
model="openai:gpt-4o",
tools=[get_weather],
)
result = await agent.run("What's the weather in Paris?")
Supported Providers
| Provider | Model Format | Example |
|---|---|---|
| OpenAI | openai:model |
openai:gpt-4o |
| Anthropic | anthropic:model |
anthropic:claude-3-5-sonnet |
google:model |
google:gemini-1.5-pro |
|
| Groq | groq:model |
groq:llama-3.1-70b |
| Ollama | ollama:model |
ollama:llama3.2 |
API Reference
Agent
from voxagent import Agent
agent = Agent(
model="provider:model", # Required: provider:model string
system_prompt="...", # Optional: system instructions
tools=[...], # Optional: list of tools
temperature=0.7, # Optional: sampling temperature
)
# Single response
result = await agent.run("prompt")
# Streaming
async for chunk in agent.stream("prompt"):
...
StreamChunk Types
from voxagent.providers import (
TextDeltaChunk, # Text content
ToolUseChunk, # Tool invocation
MessageEndChunk, # End of message
ErrorChunk, # Error occurred
)
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT License - see LICENSE for details.
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
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 voxagent-0.2.4.tar.gz.
File metadata
- Download URL: voxagent-0.2.4.tar.gz
- Upload date:
- Size: 67.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfcb774ccf018b3750df9bdac72cd650caaf4b1ee4a0b8a09775c4106c38b4b8
|
|
| MD5 |
d8b40f9341ead79e87dbdf0057c5028e
|
|
| BLAKE2b-256 |
e26e2860d348eff2e17276723addbb69c580d6a9bfa2bbc78877e2052f6ba028
|
Provenance
The following attestation bundles were made for voxagent-0.2.4.tar.gz:
Publisher:
voxagent-publish.yml on lensator/voxagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
voxagent-0.2.4.tar.gz -
Subject digest:
bfcb774ccf018b3750df9bdac72cd650caaf4b1ee4a0b8a09775c4106c38b4b8 - Sigstore transparency entry: 909273950
- Sigstore integration time:
-
Permalink:
lensator/voxagent@08dd25ad9a28b225316effa999431688cbd09437 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/lensator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
voxagent-publish.yml@08dd25ad9a28b225316effa999431688cbd09437 -
Trigger Event:
release
-
Statement type:
File details
Details for the file voxagent-0.2.4-py3-none-any.whl.
File metadata
- Download URL: voxagent-0.2.4-py3-none-any.whl
- Upload date:
- Size: 96.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab6c2b80a1c93880740104fa83f596764ef4c3c49b05a63da769b6f303524df0
|
|
| MD5 |
4b590532fa598497c00798b50c287338
|
|
| BLAKE2b-256 |
60449d42b4bd21157d56a182ea60f5b64dcce02b569fb24daf1277c7f113442f
|
Provenance
The following attestation bundles were made for voxagent-0.2.4-py3-none-any.whl:
Publisher:
voxagent-publish.yml on lensator/voxagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
voxagent-0.2.4-py3-none-any.whl -
Subject digest:
ab6c2b80a1c93880740104fa83f596764ef4c3c49b05a63da769b6f303524df0 - Sigstore transparency entry: 909273968
- Sigstore integration time:
-
Permalink:
lensator/voxagent@08dd25ad9a28b225316effa999431688cbd09437 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/lensator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
voxagent-publish.yml@08dd25ad9a28b225316effa999431688cbd09437 -
Trigger Event:
release
-
Statement type: