The easiest way to build AI agents in Python
Project description
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(). - Backend Agnostic:
- OpenAI: First-class support.
- Google Gemini: Support for all of the latest models.
- OpenRouter: Use any model via OpenRouter API compatibility.
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
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
axcent-0.1.0.tar.gz
(7.8 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 axcent-0.1.0.tar.gz.
File metadata
- Download URL: axcent-0.1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc1d78689efa44229bbaa1cce09e14c08492e69bd96d33592b76e602a40856d5
|
|
| MD5 |
4e680608c8d61cf0d9209d04f9ab4d8d
|
|
| BLAKE2b-256 |
96ce6fd591e0a5b6f6edc11fa072ada3968ee48f8d1b72c56559be607f2a620e
|
File details
Details for the file axcent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: axcent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e5e13ea656548e247990900a2a3888adf2b9eb34c0c0c3d01ec6883beafa273
|
|
| MD5 |
19650f31aa56bee8742b1e472162540a
|
|
| BLAKE2b-256 |
c97ae59829f1bb3a391f9ae45c298f4622e2fb0283a6a5d17e588bf8727d5cff
|