惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Last Week in AI
Last Week in AI
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
宝玉的分享
宝玉的分享
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园 - 聂微东
S
SegmentFault 最新的问题
博客园 - 司徒正美
罗磊的独立博客
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
小众软件
小众软件
Jina AI
Jina AI

Hugging Face - Blog

Waypoint-1.5: Higher-Fidelity Interactive Worlds for Everyday GPUs ALTK‑Evolve: On‑the‑Job Learning for AI Agents Safetensors is Joining the PyTorch Foundation Holo3: Breaking the Computer Use Frontier Any Custom Frontend with Gradio's Backend A New Framework for Evaluating Voice Agents (EVA) Bringing Robotics AI to Embedded Platforms: Dataset Recording, VLA Fine‑Tuning, and On‑Device Optimizations One-Shot Any Web App with Gradio's gr.HTML CUGA on Hugging Face: Democratizing Configurable AI Agents New in llama.cpp: Model Management Building Deep Research: How we Achieved State of the Art OVHcloud on Hugging Face Inference Providers 🔥 20x Faster TRL Fine-tuning with RapidFire AI Building for an Open Future - our new partnership with Google Cloud Aligning to What? Rethinking Agent Generalization in MiniMax M2 Building a Healthcare Robot from Simulation to Deployment with NVIDIA Isaac Sentence Transformers is joining Hugging Face! Unlock the power of images with AI Sheets Supercharge your OCR Pipelines with Open Models Google Cloud C4 Brings a 70% TCO improvement on GPT OSS with Intel and Hugging Face Get your VLM running in 3 simple steps on Intel CPUs Nemotron-Personas-India: Synthesized Data for Sovereign AI Introducing RTEB: A New Standard for Retrieval Evaluation Accelerating Qwen3-8B Agent on Intel® Core™ Ultra with Depth-Pruned Draft Models VibeGame: Exploring Vibe Coding Games Nemotron-Personas-Japan: ソブリン AI のための合成データセット Swift Transformers Reaches 1.0 – and Looks to the Future Smol2Operator: Post-Training GUI Agents for Computer Use SyGra: The One-Stop Framework for Building Data for LLMs and SLMs Gaia2 and ARE: Empowering the community to study agents
Introducing Community Tools on HuggingChat
Nathan Sarrazin · 2024-09-16 · via Hugging Face - Blog

Back to Articles

Nathan Sarrazin's avatar

Today we’re releasing our latest feature on HuggingChat: Community Tools! This lets you turn any Space that you love on HuggingFace into a tool that can be used by models directly from HuggingChat.

With this feature, we’re also expanding the modalities available in HuggingChat. You can now use community tools to understand images, generate videos, or answer with a text-to-speech model. The possibilities are endless and anyone can create tools using Spaces on Hugging Face! Explore existing tools here.

In this post we’re going to look at a few use cases for creating community tools:

  1. Turning a community Space into a tool
  2. Creating a custom tool yourself
  3. Enhance your assistants with community tools
  4. Create a RAG tool on your own documents

Turning a community Space into a tool

You can turn anyone’s public Space into a tool. This is handy for using the latest models directly in HuggingChat. Let’s use DamarJati/FLUX.1-RealismLora as an example here.

Start by creating a new tool and filling in the fields. As soon as you input the Space URL into the Hugging Face Space URL field you’ll see the available functions and parameters get filled automatically.

There are some fields that need to be filled in correctly in order to ensure optimal tool performance.

  • Tool Description: The description is passed to the LLM to explain what the tool can do. Keep it short and describe what the tool can be used for.
  • AI Function Name: The tools are represented as code functions. This is your tool’s function name. Keep it short, unique and self-explanatory.
  • Arguments: These are the tool parameters the LLM can fill-in. They can be:
    • Required: The model must fill in a value to use this tool. This required the parameter to be described properly.
    • Optional: There is a default value provided but the model can override it if needed.
    • Fixed: The value is fixed when creating the tool and can’t be changed by the model.

You can always look at other tools’ definition to better understand how to create tools. (example)

Now that our tool is created, we can enable it and start using it with tools compatible models!

Creating a custom tool yourself

Using existing Spaces can cover a lot of use cases but if you can write basic python then you can just as easily create custom tools for yourself. Let’s do a simple example of a dice roll tool since LLMs are quite bad at picking random numbers by themselves.

Start by creating a new Gradio Space on Hugging Face. The CPU Basic free tier works fine for this. Your Space will have to be public in order to be used inside HuggingChat.

Create a simple app.py app inside your pace repo, in the case of our roll dice example that could be:

import gradio as gr
import random

def roll_dice(sides=6):
    return random.randint(1, sides)

demo = gr.Interface(
    fn=roll_dice,
    inputs=gr.Number(value=6, label="Number of Sides"),
    outputs="text",
    title="Dice Roller",
    description="Enter the number of sides for the dice and get the roll result."
)

demo.launch()

If you’re not familiar with Gradio, it’s very easy to get started creating interfaces, you can find the docs here.

You can have multiple functions inside a single Space to make it easier to manage your tools.

Once you’re done, push the changes and when your Space is deployed you can create a community tool for it in HuggingChat just like we did previously.

Enhance your assistants with Community Tools

You can activate tools directly by going to the tools page and picking the ones you like or you can also package tools in an assistant.

When creating an assistant using a model that is compatible with tool calling you will now have the option to select tools. Search for the name of the tools and add up to 3 different tools. In our case, let’s create a Game Master assistant that has access to image generation and dice rolling tools.

You can use the system instructions field to tell the model when to use the tools.

Create a RAG tool on your own documents

To go along with the release we created a simple RAG tool that you can easily copy to ask questions about your documents directly from HuggingChat. Start by duplicating this Space into your own account. You can then drop files you want to be parsed in the sources/ folder of that Space.

Once the Space is started up you can easily create a tool out of it on HuggingChat like we’ve covered previously.

Share your feedback with us

With the release of Community Tools we hope you’ll be able to enhance your chats with multimodal content and custom tools. The feature is still experimental so if you see Spaces that are not supported or tools that don’t work, please share them with us in the feedback thread!