Buckets:

mishig's picture
|
download
raw
1.93 kB

tiny-agents

tiny-agents cung cấp một mẫu tối giản để xây dựng các agent sử dụng công cụ. Một vòng lặp Python nhỏ kết nối client MCP với các công cụ từ các MCP server. Hugging Face Spaces hoạt động như các MCP server. Tìm thêm các Spaces tương thích trên Hub.

Tạo một tệp cấu hình trỏ đến mô hình cục bộ và máy chủ công cụ của bạn. Ví dụ này sử dụng một Space tạo ảnh.

{
    "model": "Menlo/Jan-nano",
    "endpointUrl": "http://localhost:8000",
    "servers": [
        {
            "type": "sse",
            "url": "https://evalstate-flux1-schnell.hf.space/gradio_api/mcp/sse"
        }
    ]
}

Chạy agent với cấu hình của bạn.

tiny-agents run path/to/your/config.json

Đảm bảo transformers serve đang chạy ở chế độ nền. Agent sẽ sử dụng model cục bộ của bạn để chạy công cụ tạo ảnh.

Agent loaded with 1 tools:
 • flux1_schnell_infer
»  Generate an image of a cat on the moon
<Tool req_0_tool_call>flux1_schnell_infer {"prompt": "a cat on the moon", "seed": 42, "randomize_seed": true, "width": 1024, "height": 1024, "num_inference_steps": 4}

Tool req_0_tool_call
[Binary Content: Image image/webp, 57732 bytes]
The task is complete and the content accessible to the User
Image URL: https://evalstate-flux1-schnell.hf.space/gradio_api/file=/tmp/gradio/3dbddc0e53b5a865ed56a4e3dbdd30f3f61cf3b8aabf1b456f43e5241bd968b8/image.webp
380576952

I have generated an image of a cat on the moon using the Flux 1 Schnell Image Generator. The image is 1024x1024 pixels and was created with 4 inference steps. Let me know if you would like to make any changes or need further assistance!

Xet Storage Details

Size:
1.93 kB
·
Xet hash:
16b2038bb349b0933f0673d4f367309ce7d3dd4d16b4d52ebe539aa9b3e843dc

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.