Zero Boilerplate. Pure Magic.
Just decorate functions with @tool and let the agent orchestrate everything for you.
1from tinyagent import tool, ReactAgent
2
3 @tool
4 def multiply(a: float, b: float) -> float:
5 """Multiply two numbers together."""
6 return a * b
7
8 @tool
9 def divide(a: float, b: float) -> float:
10 """Divide the first number by the second."""
11 return a / b
12
13 agent = ReactAgent(tools=[multiply, divide])
14 result = agent.run(
15 "What is 12 times 5, then divided by 3?"
16 )
17 # → 20TinyAgent queues tool calls, runs them in order, and keeps the full trace in view.
multiply(12, 5) → 60
divide(60, 3) → 20
Report: 20
Just decorate functions with @tool and let the agent orchestrate everything for you.
Agents chain calls, reuse intermediate results, and pick the optimal path without prompts.
Ships with OpenRouter integration. Swap models like GPT-4, Claude, or Llama in one line.
End-to-end validation, retries, and predictable signatures keep production calm.
See every decision the agent makes so your code stays predictable.
Compact surface area that stays out of your way.
Local-first architecture with no hidden remote calls.
Every abstraction earns its keep. No fluff.
Agents operate for you, not the cloud vendor.
Create a virtual env, install TinyAgent, point it at your key.
Bootstrap
1uv venv
2source .venv/bin/activate
3uv pip install tiny_agent_osEnvironment
1export OPENAI_API_KEY=your_openrouter_key_here
2export OPENAI_BASE_URL=https://openrouter.ai/api/v1Write tools as plain Python. TinyAgent works out the order and explains its answer.
1from tinyagent import tool, ReactAgent
2
3@tool
4def calculate_percentage(value: float, percentage: float) -> float:
5 """Calculate what percentage of a value is."""
6 return value * (percentage / 100)
7
8@tool
9def subtract(a: float, b: float) -> float:
10 """Subtract b from a."""
11 return a - b
12
13agent = ReactAgent(tools=[calculate_percentage, subtract])
14result = agent.run("If I have 15 apples and give away 40%, how many are left?")
15print(result) # -> "You have 9 apples left."Pull the Brave Search tool when you need fresh data and keep the answer inside the reasoning trace.
1from tinyagent import ReactAgent
2from tinyagent.base_tools import web_search
3
4agent = ReactAgent(tools=[web_search])
5agent.run("What are the latest Python web frameworks?")
6
7agent = ReactAgent(tools=[web_search])
8agent.run("Compare FastAPI vs Django performance")Resources
Business Source License 1.1 — free under $1M ARR. Enterprise? email info@alchemiststudios.ai.
Tiny. Local. Lethal.