Unlocking the Power of Community Tools on HuggingChat
Today marks an exciting milestone for HuggingChat users as we unveil our latest feature: Community Tools! This innovative update allows you to transform any cherished Space from Hugging Face into a powerful tool that models can utilize directly within HuggingChat. With the addition of Community Tools, the capabilities of HuggingChat have expanded significantly, enabling users to interact with a variety of modalities such as images, videos, and even text-to-speech models. Let’s delve into the myriad possibilities and practical applications of this feature.
What Are Community Tools?
Community Tools empower users to create custom functionalities from existing Spaces on Hugging Face. Whether you’re looking to analyze images, generate videos, or communicate using voice, the options are virtually limitless. What’s more, anyone can craft their own tools using Spaces, making it an inclusive platform for developers and enthusiasts alike. You can explore and discover existing tools here.
Use Cases for Creating Community Tools
The versatility of Community Tools lends itself to several engaging applications. Here are a few key use cases to inspire your creativity:
- Turning a Community Space into a Tool
- Creating a Custom Tool Yourself
- Enhancing Your Assistants with Community Tools
- Creating a RAG Tool on Your Own Documents
Turning a Community Space into a Tool
One of the most straightforward ways to utilize Community Tools is by converting any public Space into a tool. This feature is particularly beneficial for accessing the latest models directly within HuggingChat. For instance, consider the Space DamarJati/FLUX.1-RealismLora.
To begin, create a new tool and fill in the necessary fields. Simply input the Space URL into the Hugging Face Space URL field, and watch as the available functions and parameters auto-populate.
Key Fields to Fill for Optimal Tool Performance
When creating a tool, it’s crucial to complete a few fields accurately to ensure its functionality:
-
Tool Description: Provide a concise yet informative description of what the tool does. This description is communicated to the LLM, so clarity is essential.
-
AI Function Name: The tool is represented as a code function. Choose a name that is short, unique, and self-explanatory.
- Arguments: These are the parameters the LLM can utilize, categorized as:
- Required: Must be filled for the tool to function.
- Optional: Comes with a default value but can be overridden.
- Fixed: The value is immutable upon tool creation.
For reference, you can look at the definitions of other tools to gain a better understanding of how to craft your own.
Once the tool is created, simply enable it, and you can start using it with compatible models!
Creating a Custom Tool Yourself
While leveraging existing Spaces is highly effective, you might want to create a custom tool tailored to your specific needs. If you have basic Python skills, you can easily develop your own tool. Let’s take a simple example: a dice rolling tool, as LLMs often struggle with generating random numbers.
Steps to Create Your Dice Roller
-
Create a New Gradio Space: Opt for the CPU Basic free tier, as it suits this purpose perfectly. Ensure your Space is public for it to be utilized within HuggingChat.
-
Develop Your Application: In your Space repo, create a simple
app.pyfile. Here’s a sample code for a dice rolling tool: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() - Deploy Your Space: Once you push your changes, your Space will be live, and you can create a community tool for it in HuggingChat.
Enhance Your Assistants with Community Tools
Community Tools can also be integrated into your assistants, enhancing their functionality. You can easily activate tools by visiting the tools page and selecting your favorites. When crafting an assistant, especially one that uses a model capable of tool calling, you can choose from various tools, adding up to three at a time.
For example, if you’re developing a Game Master assistant, you could incorporate both image generation and dice rolling tools to enrich the gaming experience. You can utilize the system instructions field to guide the model on when to utilize these tools effectively.
Create a RAG Tool on Your Own Documents
The release of Community Tools also includes a straightforward RAG (Retrieval-Augmented Generation) tool that allows you to query your documents directly from HuggingChat. To get started, simply duplicate the provided Space into your own Hugging Face account, and then upload the files you wish to have parsed into the sources/ folder.
Once your Space is operational, you can easily create a tool from it within HuggingChat, just as we discussed earlier.
Share Your Feedback with Us
As we roll out Community Tools, we encourage you to explore these new features and enhance your chats with multimodal content and custom functionalities. Since this feature is still in its experimental phase, we welcome your feedback on any unsupported Spaces or tools that may not function correctly. Your insights are invaluable in helping us improve the HuggingChat experience!
With Community Tools, the potential for creativity and interaction is boundless—so dive in and start building!
Inspired by: Source

