Axcent
The easiest way to build AI agents in Python.
Axcent is a lightweight framework designed to let you build powerful AI agents with tool calling, context caching, and multi-backend support in just a few lines of code.
Installation
pip install axcent
To use Gemini models:
pip install axcent[gemini]
Quick Start (OpenAI)
import os
from axcent import Agent
# Set your API Key
os.environ["OPENAI_API_KEY"] = "sk-..."
# Initialize Agent
agent = Agent(system_prompt="You are a helpful assistant.")
# Register a Tool
@agent.tool
def get_weather(city: str) -> str:
"""Returns weather info for a city."""
return f"The weather in {city} is sunny!"
# Ask away!
response = agent.ask("What is the weather in Tokyo?")
print(response)
Features
- Simple Tool Registration: Just use
@agent.tool. - Automatic Context Caching: Optimizes token usage by enforcing stable prompt structures.
- Token Monitoring: Track prompt, completion, and cached tokens via
agent.get_total_usage(). - Multimodal Support: Process images and audio with the
Transcriberclass. - Backend Agnostic:
- OpenAI: First-class support with vision.
- Google Gemini: Support for all latest models including multimodal.
- OpenRouter: Use any model via OpenRouter API compatibility.
Multimodal: Images & Audio
Axcent v0.3.0 introduces multimodal capabilities. Use the Transcriber class to let your agent "see" images and "hear" audio.
from axcent import Agent, Transcriber
from axcent.llm import GeminiBackend
agent = Agent(system_prompt="You are a helpful assistant.")
@agent.tool
def see_media(path: str) -> str:
"""Analyze an image or audio file."""
transcriber = Transcriber(
system_prompt="Describe this media briefly.",
backend=GeminiBackend()
)
return transcriber.transcribe_file(path)
# Now the agent can understand media files!
response = agent.ask("What's in /path/to/image.jpg?")
You can also send images/audio directly with ask():
from axcent import Agent, Image
agent = Agent(model="gpt-4o") # Vision-capable model
img = Image(url="https://example.com/photo.jpg")
response = agent.ask("What's in this image?", media=[img])
Multi-Backend Usage
Google Gemini
from axcent import Agent, GeminiBackend
import os
# Set API Key (or GOOGLE_API_KEY)
os.environ["GEMINI_API_KEY"] = "AIza..."
# Use Gemini Backend (uses google-genai V2 SDK)
backend = GeminiBackend(model="gemini-3-flash")
agent = Agent(system_prompt="You are a helper.", backend=backend)
OpenRouter
import os
from axcent import Agent
os.environ["OPENAI_API_KEY"] = "sk-or-..."
os.environ["OPENAI_BASE_URL"] = "https://openrouter.ai/api/v1"
agent = Agent(system_prompt="You are a helper.")
License
MIT
Metadata
Release files for axcent 0.6.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 | |
|---|---|---|---|
| axcent-0.6.0.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| axcent-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.2 kB
Release files / axcent-0.6.0.tar.gz
| Download URL | axcent-0.6.0.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b65233cfff2f4d727b7e83c7875356dd7473bcd2a542046dea0932e3746b08b3
|
|
BLAKE2b-256 checksum How to use checksums |
1982c355c78d425d635f90915f72d9f2b08aee21a44df7ae00ae3e413588f5a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / axcent-0.6.0-py3-none-any.whl
| Download URL | axcent-0.6.0-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3768400531019d616381776d7014f6e4b44b926ad83c70d6e5afe38e35836b5e
|
|
BLAKE2b-256 checksum How to use checksums |
97f9838173916a2e0cd5a2dedf74dd6d7a60d269e3c8add64d13971d0c3e9aa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|