Skip to main content

Tiny agentic framework for building AI agents which can do more than tiny just tasks.

Project description

TinyGent Logo

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

  1. Clone the tinygent repository to your local machine.

    git clone git@github.com:filchy/tinygent.git tinygent
    cd tinygent
    
  2. Create a Python environment.

    uv venv --seed .venv
    source .venv/bin/activate
    
  3. Install the tinygent library. To install only the core tinygent library without any optional dependencies, run the following:

    uv sync
    

    To 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.

  4. Install tinygent in editable mode (development mode), so that changes in the source code are immediately reflected:

    uv pip install -e .
    

Examples (Quick Start)

  1. Ensure you have set the OPENAI_API_KEY environment variable to allow the example to use OpenAI's API. An API key can be obtained from openai.com.

    export OPENAI_API_KEY="your_openai_api_key"
    
  2. Run the examples using uv:

    uv run examples/agents/multi-step/main.py
    
  3. Explore more examples below:

Basics

  1. Tool Usage
  2. LLM Usage
  3. Function Calling

Memory

  1. Chat Buffer Memory
  2. Summary Buffer Memory
  3. Window Buffer Memory
  4. Combined Memory

Tools

  1. Basic Tools
  2. Reasoning Tools
  3. JIT Tools

Agents

  1. Middlewares in Agents
  2. ReAct Agent
  3. Multi-Step Agent
  4. Squad Agent
  5. Modular Agentic Planner Agent

Packages

  1. Brave Tools
  2. Tiny Chat
  3. Tiny OpenAI
  4. Tiny MistralAI
  5. Tiny Gemini
  6. Tiny Anthropic
  7. Tiny VoyageAI
  8. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinygent-0.1.1.tar.gz (357.9 kB view details)

Uploaded Source

Built Distribution

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

tinygent-0.1.1-py3-none-any.whl (113.2 kB view details)

Uploaded Python 3

File details

Details for the file tinygent-0.1.1.tar.gz.

File metadata

  • Download URL: tinygent-0.1.1.tar.gz
  • Upload date:
  • Size: 357.9 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

Hashes for tinygent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f1774d05c6e6ceaa7cad21f7c90d32962b189d65343c6559f0d78c0b7c7ab611
MD5 6742fa81f1595219bf30790dc95c0ce1
BLAKE2b-256 445027a907fc21cdc47fdf06863fc863998114bb77ba3934f4a461541751d011

See more details on using hashes here.

File details

Details for the file tinygent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tinygent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 113.2 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

Hashes for tinygent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70a2efaa87345bad1430532e352eeef8924149e2be0c9fb6751f6e4869cc4889
MD5 34ce81fa71efce9833de89d3d3c2c376
BLAKE2b-256 c3bc7af2e38d4cca9a5f218dd9b419a7467ffe9be39300067017a2c2cba533bd

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