Skip to main content

A lightweight, model-agnostic LLM provider abstraction with streaming and tool support

Project description

voxagent

PyPI version Python 3.11+ License: MIT Typed

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 StreamChunk union (TextDelta, ToolUse, MessageEnd, Error)
  • Tool System: @tool decorator for easy function-to-tool conversion
  • MCP Integration: First-class Model Context Protocol support
  • Type Safe: Full type hints with py.typed marker
  • 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 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

voxagent-0.2.0.tar.gz (66.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

voxagent-0.2.0-py3-none-any.whl (95.5 kB view details)

Uploaded Python 3

File details

Details for the file voxagent-0.2.0.tar.gz.

File metadata

  • Download URL: voxagent-0.2.0.tar.gz
  • Upload date:
  • Size: 66.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for voxagent-0.2.0.tar.gz
Algorithm Hash digest
SHA256 de39d8318b00a7263689305481956037619e7f3e07431fb0e4933b5df04b67b5
MD5 c4b72e6c973387530390bfbbcb20c0c7
BLAKE2b-256 a284ff2e708d49b831663113b3b7e21e7467ae72aee29f288e64403c708506eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for voxagent-0.2.0.tar.gz:

Publisher: voxagent-publish.yml on lensator/voxagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file voxagent-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: voxagent-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 95.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for voxagent-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e2662f8baea9c452f54a6b85b8b4d91675e26f369fc51f2d8e5196c8c7b9d6d
MD5 98a8cebf90794e8e0ed6d4b23830ffb6
BLAKE2b-256 ff56f78c96ea814c07d3c48c18557c11e3e8bbd0a77be4887dadd03ea7991028

See more details on using hashes here.

Provenance

The following attestation bundles were made for voxagent-0.2.0-py3-none-any.whl:

Publisher: voxagent-publish.yml on lensator/voxagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page