Skip to content

Commit b20d7c5

Browse files
authored
Load tiny-agents from Hub (#1472)
As discussed offline, this PR moves the curated collection of tiny-agents to the Hub. Agents must now be contributed to https://huggingface.co/datasets/huggingface/tiny-agents. This will be helpful to maintain the collection independently from the `@huggingface/tiny-agents` releases. It also makes them available for the incoming Python equivalent (huggingface/huggingface_hub#3098). File resolution is still the same: 1. if agent_id is a file => load it as a `agent.json` file 2. if agent_id is a directory => load from it 3. if agent_id is a subdirectory in https://huggingface.co/datasets/huggingface/tiny-agents/tree/main => load from it 4. otherwise raise exception Usage is still: ```bash npx @huggingface/tiny-agents run "julien-c/flux-schnell-generator" ```
1 parent 6ba8619 commit b20d7c5

File tree

13 files changed

+126
-121
lines changed

13 files changed

+126
-121
lines changed

packages/tiny-agents/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,19 @@ npx @huggingface/tiny-agents run ./my-agent
8585

8686
Voilà! 🔥
8787

88+
89+
## Tiny Agents collection
90+
91+
Browse our curated collection of Tiny Agents at https://huggingface.co/datasets/tiny-agents/tiny-agents. Each agent is stored in its own subdirectory, following the structure outlined above. Running an agent from the Hub is as simple as using its `agent_id`. For example, to run the [`julien-c/flux-schnell-generator`](https://huggingface.co/datasets/tiny-agents/tiny-agents/tree/main/julien-c/flux-schnell-generator) agent:
92+
93+
```bash
94+
npx @huggingface/tiny-agents run "julien-c/flux-schnell-generator"
95+
```
96+
8897
> [!NOTE]
89-
> Note: you can open a PR in the huggingface.js repo to share your agent with the community, just upload it inside the `src/agents/` directory.
98+
> Want to share your own agent with the community? Submit a PR to the [Tiny Agents](https://huggingface.co/datasets/tiny-agents/tiny-agents/discussions) repository on the Hub. Your submission must include an `agent.json` file, and you can optionally add a `PROMPT.md` file. To help others understand your agent's capabilities, consider including an `EXAMPLES.md` file with sample prompts and use cases.
9099
91-
### Advanced: Programmatic Usage
100+
## Advanced: Programmatic Usage
92101

93102
```typescript
94103
import { Agent } from '@huggingface/tiny-agents';

packages/tiny-agents/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@huggingface/inference": "workspace:^",
5555
"@huggingface/mcp-client": "workspace:^",
5656
"@huggingface/tasks": "workspace:^",
57+
"@huggingface/hub": "workspace:^",
5758
"@modelcontextprotocol/sdk": "^1.11.4",
5859
"zod": "^3.25.7"
5960
}

packages/tiny-agents/pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tiny-agents/src/agents/evalstate/hf-search/PROMPT.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/tiny-agents/src/agents/evalstate/hf-search/agent.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/tiny-agents/src/agents/evalstate/hf.js-assistant/PROMPT.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/tiny-agents/src/agents/evalstate/hf.js-assistant/agent.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/tiny-agents/src/agents/julien-c/flux-schnell-generator/agent.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/tiny-agents/src/agents/julien-c/local-coder/PROMPT.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/tiny-agents/src/agents/julien-c/local-coder/agent.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)