Today we are releasing the latest features of HuggingChat: Community Tools. This allows you to use any space you like from HuggingChat to tools that your models can use directly from HuggingChat.
This feature also expands the modalities available on Huggingchat. You can now use community tools to understand images, generate videos, and answer using models that speak from text. The possibilities are endless, and anyone can create tools using a space to hug their faces! See existing tools here.
In this post we will look at some use cases for creating community tools.
Create custom tools that turn community spaces into tools Enhance your assistants with community tools.
Turn community spaces into tools
Whose public space can be turned into a tool. This is useful for using the latest models directly with Huggingchat. Let’s use Damarjati/Flux.1-Realismlora as an example.
Start by creating a new tool and filling in the fields. As soon as you enter the Face Space URL into the hugging Face Space URL field, you will see that the available features and parameters will be automatically filled.
There are several fields that need to be filled correctly to ensure optimal tool performance.
Tool Description: The description is passed to LLM to explain what the tool can do. Keep it short and explain what you can use the tool. AI function name: Tools are represented as code functions. This is the feature name for your tool. Keep it short, unique, and self-explanatory. Arguments: These are tool parameters that LLM can fill. Required: To use this tool, the model must enter a value. This required proper explanation of the parameters. Optional: Default values are provided, but the model can be overridden if desired. Modify: Values are modified when creating the tool and cannot be changed by model.
You can always look at the definitions of other tools and get a better understanding of how to create them. (example)

Now that the tool is created, you can enable it and start using it with your tool compatible model!

Create your own custom tools
Using existing spaces will cover many use cases, but if you can write basic Python, you can easily create custom tools for yourself. LLMS is very bad at picking random numbers on its own, so let’s give a simple example of the dice roll tool.
Start by creating a new gradient space that hugs your face. CPU Basic Free Tier supports this. To use within Huggingchat, the space must be exposed.
Create a simple app.py app inside the pace repository.
Import Gradation As gr
Import random
def roll_dice(Side =6):
return random.randint (1,sides) demo = gr.interface(fn = roll_dice, inputs = gr.number(value=6label =“Number of sides”), output =“Sentence”title =“Dice Roller”description =“Enter the number of dice sides to get the roll results.”
) demo.launch()
If you’re new to Gradio, it’s very easy to start creating an interface. You can find the documentation here.
Multiple features can be used within a single space to make the tool easier to manage.
Once done, you can push the changes and once the spaces are expanded, you can create community tools in Huggingchat just like before.

Strengthen your assistant with community tools
You can activate the tool directly by going to the Tools page and selecting the page you like. You can also package the tools into your assistant.
If you create an assistant using a model that is compatible with tool calls, you will be presented with the option to select a tool. Search for the name of the tool and add up to three different tools. In our case, let’s create a Game Master Assistant with access to image generation and dice rolling tools.
System instruction fields can be used to tell the model when to use the tool.

Create RAG tools in your own document
We’ve created a simple RAG tool that allows you to easily copy and ask questions about the documentation for release. Start by replicating this space into your own account. You can then drop the files to parse into the source/folder for that space.

Once the space has started, you can easily create tools with Huggingchat, as you covered before.

Please share your feedback with us
We hope that the release of Community Tools will help you enhance your chat with multimodal content and custom tools. This feature is still experimental, so if you see unsupported spaces or tools that don’t work, share them in the feedback thread.