TinyCodeAgent / README.md
Mahdiyar
more examples
9379a6d

A newer version of the Gradio SDK is available: 5.34.2

Upgrade
metadata
title: TinyCodeAgent
emoji: 🐣
colorFrom: indigo
colorTo: yellow
sdk: gradio
sdk_version: 5.33.1
app_file: app.py
pinned: true
license: apache-2.0
short_description: Think in python and execute code to solve a task
tags:
  - agent-demo-track
  - mcp-server-track
  - mcp
  - code-agent

TinyCodeAgent

πŸš€ TinyCodeAgent: A Self-Building, Self-Debugging Python Agent in the Cloud πŸš€

Demo

Watch the demo on YouTube

Watch Demo on YouTube

In this demo, watch how TinyCodeAgent:

  1. Thinks in Python

    • Dynamically generates Python code in the cloud
    • Instantly executes and tests its own snippets
  2. Builds Its Own Tools

    • Creates helper functions on the fly
    • Integrates new modules to extend its capabilities
  3. Runs & Debugs

    • Detects errors, logs tracebacks
    • Auto-corrects and re-runs until the task is solved

πŸ” Demo Workflow

  • Step 1: List the most popular Spaces on Hugging Face
  • Step 2: Filter for upcoming Hackathon Spaces without prerequisites
  • Step 3: Display results in a clean, interactive format

Why TinyCodeAgent?

  • Built on **TinyAgent **, a lightweight AI agent framework
  • Extendable hooks system for easy customization
  • Simple event loop ensures stability and fast iteration

You can extend it using TinyAgent Hooks system, and use it with Gradio Integration. Your agent could become a MCP Server or tool for another agent.

This Project is using Qwen/Qwen3-235B-A22B from Nebius thanks to their support.

Benefits

  • Stateful python code using Modal Functions (Instead of using a sandbox, Faster and cheaper)
  • Use TinyAgent Hooks system to extend your agent
  • Use Gradio Integration to use your agent as a tool for another agent
  • Log System
  • Storage
  • Multi MCP Connections
  • Support Models through LiteLLM

Examples

  • What are the most popular Spaces on Hugging Face today?

  • Please calculate the root mean square error of the following data:

    • [1, 2, 3, 4, 5]
    • [1, 2, 3, 4, 5]
  • How is the weather in Paris? What about the traffic? [Uses dummy functions, for demo purposes]

  • How is traffic right now in Paris, Montreal, Tokyo and London?

Credits

  • TinyAgent I have built this project as well.
  • Modal I use Modal Functions to run python code.
  • Gradio I use Gradio to create a web interface for my agent.
  • Cloudpickle I use Cloudpickle to serialize and deserialize python objects.
  • SmolAgents Use SmolAgents Coding Agent System Prompt as a base for my system prompt.