|
--- |
|
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** |
|
|
|
[](https://youtu.be/CGFSc9Jf5vw) |
|
|
|
|
|
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](https://github.com/askbudi/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](https://nebius.ai/) 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](https://github.com/askbudi/tinyagent) I have built this project as well. |
|
- [Modal](https://modal.com/) I use Modal Functions to run python code. |
|
- [Gradio](https://gradio.app/) I use Gradio to create a web interface for my agent. |
|
- [Cloudpickle](https://github.com/cloudpipe/cloudpickle) I use Cloudpickle to serialize and deserialize python objects. |
|
- [SmolAgents](https://github.com/huggingface/smolagents) Use SmolAgents Coding Agent System Prompt as a base for my system prompt. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|