Tiny agentic framework for building AI agents which can do more than tiny just tasks.
Project description
Tiny platform for amazing agents.
Homepage | Documentation
Tinygent is a tiny agentic framework - lightweight, easy to use (hopefully), and efficient (also hopefully ;-0) library for building and deploying generative AI applications. It provides a simple interface for working with various models and tools, making it ideal for developers who want to quickly prototype and deploy AI solutions.
Create an agent
# uv sync --extra openai
from tinygent.tools import tool
from tinygent.core.factory import build_agent
@tool
def get_weather(location: str) -> str:
"""Get the current weather in a given location."""
return f'The weather in {location} is sunny with a high of 75°F.'
agent = build_agent(
'react',
llm='openai:gpt-4o-mini',
tools=[get_weather],
)
print(agent.run('What is the weather like in Prague?'))
Getting Started
Prerequisites
Before you begin using tinygent, ensure that you meet the following software prerequisites.
Install From Source
-
Clone the tinygent repository to your local machine.
git clone git@github.com:filchy/tinygent.git tinygent cd tinygent
-
Create a Python environment.
uv venv --seed .venv source .venv/bin/activate
-
Install the tinygent library. To install only the core tinygent library without any optional dependencies, run the following:
uv syncTo install the tinygent library along with all of the optional dependencies. Including developer tools (
--all-groups), additional packages and all of the dependencies needed for profiling and plugins (--all-extras) in the source repository, run the following:uv sync --all-groups --all-extras
[!NOTE] Not all packages are included in the default installation to keep the library lightweight. You can customize your installation by specifying the optional dependencies you need.
-
Install tinygent in editable mode (development mode), so that changes in the source code are immediately reflected:
uv pip install -e .
Examples (Quick Start)
-
Ensure you have set the
OPENAI_API_KEYenvironment variable to allow the example to use OpenAI's API. An API key can be obtained fromopenai.com.export OPENAI_API_KEY="your_openai_api_key"
-
Run the examples using
uv:uv run examples/agents/multi-step/main.py
-
Explore more examples below:
Basics
Memory
Tools
Agents
Packages
- Brave Tools
- Tiny Chat
- Tiny OpenAI
- Tiny MistralAI
- Tiny Gemini
- Tiny Anthropic
- Tiny VoyageAI
- Tiny Graph
Linting & Formatting
To ensure code quality, formatting consistency, and type safety, run:
uv run fmt # Format code Ruff
uv run lint # Run Ruff linter and Mypy type checks
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 tinygent-0.1.1006.tar.gz.
File metadata
- Download URL: tinygent-0.1.1006.tar.gz
- Upload date:
- Size: 358.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3513498d297f1e674a10418629dacee9cec595d659c2b4aaff0a797e0bf66f24
|
|
| MD5 |
b4bf598078d999b5e944d9232239f186
|
|
| BLAKE2b-256 |
6fd370652d4d7e902839bb65d468c87cdab01fb539775d9578064adaee2da12e
|
File details
Details for the file tinygent-0.1.1006-py3-none-any.whl.
File metadata
- Download URL: tinygent-0.1.1006-py3-none-any.whl
- Upload date:
- Size: 113.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbf9eb6b20eab13032a764f24193087570613f579d5762a1d4bf2c18e1581749
|
|
| MD5 |
114df585d7864ff4ad46108c36badc1b
|
|
| BLAKE2b-256 |
1b934fc4ab5415d2bc572448d30e858ee93021517d16edac459cc3f94d81744f
|