Skip to main content

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.2.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

axcent-0.2.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: axcent-0.2.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for axcent-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9aeb998a6a4972c00130ba9de78095b34d3d0bbb1d695f3b5e0241d2825bf527
MD5 1fc818eaac7c9821de424ec411d9ad25
BLAKE2b-256 78cea7560c02dd299efd0de8dcf6f4e8decbb18e67d8b8da4d2fd0660ddab06e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: axcent-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for axcent-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 570489cf4bd2738f07995ab35c562e8046112e3d40c214f8f64e7d2442afb0a7
MD5 8b6f781b0b038ccf7f9d1ad0d0e3fdca
BLAKE2b-256 906c2ec5048d7fd1529cb58a5f7fad6f013c761858f28443c8cd530bed0f1087

See more details on using hashes here.

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