Skip to content

Update tiny-agent format to follow VSCode format #1556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 2, 2025

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Jun 25, 2025

Same PR as huggingface/huggingface_hub#3166 in Python.

This PR introduces breaking changes but I think it's best to do it now. Goal is to have the same format as VSCode MCP config e.g.

{
  "model": "Qwen/Qwen2.5-72B-Instruct",
  "provider": "nebius",
  "inputs": [
    {
      "type": "promptString",
      "id": "hf-token",
      "description": "Token for Hugging Face API access",
      "password": true
    }
  ],
  "servers": [
    {
      "type": "http",
      "url": "https://huggingface.co/mcp",
      "headers": {
        "Authorization": "Bearer ${input:hf-token}"
      }
    }
  ]
}

breaking changes:

  • no more config nested mapping => everything at root level
  • headers at root level instead of inside options.requestInit
  • updated the way values are pulled from ENV (based on input id)

Once this PR and huggingface/huggingface_hub#3166 are approved, we can merge + release them at the same time + update the config in https://huggingface.co/datasets/tiny-agents/tiny-agents to follow the new convention. For now, only wauplin/library-pr-reviewer has been updated for testing.

pnpm run cli run wauplin/library-pr-reviewer

EDIT: PR merged and released. Made a release on Python SDK as well and updated all configs in https://huggingface.co/datasets/tiny-agents/tiny-agents.

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean!

@@ -4,6 +4,7 @@ import * as readline from "node:readline/promises";
import { stdin, stdout } from "node:process";
import { z } from "zod";
import { PROVIDERS_OR_POLICIES } from "@huggingface/inference";
import type { ServerConfig } from "@huggingface/mcp-client";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit confusing to have the same name for something different in mcp-client vs. tiny-agent, but I guess this one's on me 😀

i guess we could potentially rename the one in mcp-client to McpServerConfig but 🤷

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you!

EDIT: We should remove the "config" nested mapping in https://github.com/huggingface/huggingface.js/blob/main/packages/tiny-agents/test/ServerConfigSchema.spec.ts

@Wauplin
Copy link
Contributor Author

Wauplin commented Jul 2, 2025

EDIT: We should remove the "config" nested mapping in https://github.com/huggingface/huggingface.js/blob/main/packages/tiny-agents/test/ServerConfigSchema.spec.ts

Indeed! Done in 477c01d

@Wauplin Wauplin merged commit cab9f0c into main Jul 2, 2025
5 checks passed
@Wauplin Wauplin deleted the tiny-agent-vscode-format branch July 2, 2025 06:19
Wauplin added a commit that referenced this pull request Jul 7, 2025
Fix docs example after
huggingface/huggingface_hub#3166 /
#1556. Since release
[0.33.2](https://github.com/huggingface/huggingface_hub/releases/tag/v0.33.2)
`tiny-agents` config follow VSCode format. We made the change without a
proper deprecation warning as it's still experimental and we wanted to
harmonize with VSCode as quickly as possible (to avoid future
conflicts).

Related PRs:
- huggingface/hub-docs#1816
- huggingface/transformers#39245
- huggingface/huggingface_hub#3205
- #1599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants