Tinyagent

tinyAgent uniquely treats functions as first-class citizens, easily transforming them into powerful AI tools. Inspired by human organizational structures, it dynamically orchestrates specialized agents, balancing security and capability for complex tasks.

Last verified:

Visit Tinyagent

What is Tinyagent?

tinyAgent is a lightweight, local-first AI framework designed for developers who value efficiency, modularity, and control. It lets you wrap any Python function with a simple @tool decorator, combine agents to solve complex problems, and leverage experimental meta-agents. The framework provides a streaming-first architecture with zero boilerplate, automatic reasoning, and built-in LLM support through OpenRouter.

core features include ReactAgent for multi-step reasoning that breaks down complex problems automatically, TinyCodeAgent as a specialized coding assistant, and built-in web search capabilities via Brave Search API. The framework supports type-safe operations with full type hints and validation, production-ready error handling with built-in retry logic, and works out-of-the-box with any LLM supporting the OpenAI API format including GPT-4o-mini, Claude 3.5 Sonnet, and Llama 3.1 70B.

tinyAgent is ideal for developers building conversational AI agents with tool use capabilities, those who want clean simple orchestration with tool support right out of the box, and anyone creating edge-deployed AI systems that value privacy and local execution. It's particularly suited for personal projects, small businesses, and developers who prefer modularity over bloat.

Tinyagent pricing

Pricing model: Freemium

Business Source License 1.1 (BSL 1.1): Free for individuals and small businesses with under $1M annual revenue. Commercial use by larger businesses requires an enterprise license. Contact [email protected] or [email protected] for enterprise licensing. The package is available via pip (tiny_agent_os) and UV. API costs apply for OpenRouter (required) and Brave Search API (optional for web search).

Tinyagent pros

  • Zero boilerplate - just decorate functions with @tool
  • Automatic reasoning - agent figures out tool usage order
  • Built-in LLM support works out of the box with OpenRouter
  • Type-safe with full type hints and validation
  • Production-ready error handling and retries
  • Multi-step reasoning breaks down complex problems automatically
  • Clean, ergonomic API interface
  • Streaming-first architecture
  • Lightweight with small footprint
  • Local-first for privacy and offline capability
  • Built-in web search with Brave Search API
  • Works with any OpenAI API-compatible LLM
  • Modular and extensible architecture
  • Open-source under BSL license
  • Free for individuals and small businesses under $1M revenue
  • Built-in reflection loop for self-improvement
  • Dynamic query handling
  • No bloat - just useful logic

Tinyagent cons

  • Currently in BETA - breaking changes possible until v1.0
  • Requires OpenRouter API key for LLM access
  • BSL license restricts commercial use for larger companies
  • Enterprise license required for companies over $1M revenue
  • Web search requires separate Brave Search API key
  • Experimental meta-agents still in early rough beta
  • Orchestrator feature still very rough in early beta
  • Limited to Python ecosystem
  • Active development means documentation may lag behind

Frequently asked questions about Tinyagent

What is tinyAgent?

tinyAgent is a lightweight, local-first AI framework that lets you wrap any Python function with a simple @tool decorator to create AI-powered agents. It combines agents to solve complex problems and supports experimental meta-agents. The framework is designed for developers who value efficiency, modularity, and control.

How do I install tinyAgent?

You can install tinyAgent using UV (recommended, 10x faster): run 'uv venv', 'source .venv/bin/activate', then 'uv pip install tiny_agent_os'. Alternatively, use traditional pip: 'pip install tiny_agent_os'. For the legacy v0.72.x codebase, install with 'pip install tiny-agent-os==0.72.18'.

What API key do I need?

You need an OpenRouter API key to use tinyAgent. Set it via environment variables: export OPENAI_API_KEY=your_openrouter_key and export OPENAI_BASE_URL=https://openrouter.ai/api/v1. Get your key at openrouter.ai. For web search functionality, you also need a Brave Search API key.

What models does tinyAgent support?

tinyAgent works with any OpenAI API-compatible LLM. You can specify models when creating the agent: gpt-4o-mini, anthropic/claude-3.5-sonnet, meta-llama/llama-3.1-70b-instruct, deepseek-v3, and others. The default model is used if not specified, and models supporting structured outputs have it enabled by default.

What is ReactAgent?

ReactAgent is tinyAgent's main agent class that provides multi-step reasoning, automatically breaking down complex problems. It features a clean, ergonomic API, built-in retry logic, and graceful error handling. The agent automatically figures out which tools to use and in what order to solve queries.

What is TinyCodeAgent?

TinyCodeAgent is a specialized coding assistant agent within tinyAgent with enhanced code understanding. It works the same way as ReactAgent - you pass tools to it and specify a model. It's part of the reorganized package structure as of v0.73.

How do I create a tool?

Create a tool by decorating a Python function with @tool. The function should have type hints for parameters and a docstring explaining its purpose. Example: @tool def multiply(a: float, b: float) -> float: '''Multiply two numbers.''' return a * b. Keep tools atomic, typed, and documented for best LLM understanding.

Can I use tinyAgent offline?

tinyAgent is local-first and designed for edge deployment, but it requires an API key for LLM access through OpenRouter, which needs internet connectivity. For truly offline use, you can configure a local model by setting BASE_URL to localhost and specifying a local model name, as long as it uses the OpenAI API format.

Is tinyAgent open source?

Yes, tinyAgent is open-source under the Business Source License 1.1 (BSL). The codebase is available on GitHub at github.com/alchemiststudiosDOTai/tinyAgent. It's free for individuals and small businesses under $1M annual revenue, but larger companies need an enterprise license.

What is the current development status?

tinyAgent is currently in BETA and is actively developed and used in production. Breaking changes are possible until v1.0 is released. The core tooling works 100%, especially with structured outputs, but some features like the orchestrator and meta-agents are still in very early rough beta.

Categories

Use cases

Browse all AI tools on NeedAnAI