> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/huggingface.md).

# huggingface

[HuggingFace](https://huggingface.co/) is a leading AI platform that provides access to thousands of pre-trained machine learning models and powerful inference capabilities. With its extensive model hub and robust API, HuggingFace offers comprehensive tools for both research and production AI applications.

With HuggingFace, you can:

* Access pre-trained models: Utilize models for text generation, translation, image processing, and more
* Generate AI completions: Create content using state-of-the-art language models through the Inference API
* Natural language processing: Process and analyze text with specialized NLP models
* Deploy at scale: Host and serve models for production applications
* Customize models: Fine-tune existing models for specific use cases

In Agent Forge, the HuggingFace integration enables your agents to programmatically generate completions using the HuggingFace Inference API. This allows for powerful automation scenarios such as content generation, text analysis, code completion, and creative writing. Your agents can generate completions with natural language prompts, access specialized models for different tasks, and integrate AI-generated content into workflows. This integration bridges the gap between your AI workflows and machine learning capabilities, enabling seamless AI-powered automation with one of the world's most comprehensive ML platforms.

### Usage Instructions

Generate completions using Hugging Face Inference API with access to various open-source models. Leverage cutting-edge AI models for chat completions, content generation, and AI-powered conversations with customizable parameters.

### Tools

#### `huggingface_chat`

Generate completions using Hugging Face Inference API

**Input**

| Parameter      | Type   | Required | Description                                                            |
| -------------- | ------ | -------- | ---------------------------------------------------------------------- |
| `systemPrompt` | string | No       | System prompt to guide the model behavior                              |
| `content`      | string | Yes      | The user message content to send to the model                          |
| `provider`     | string | Yes      | The provider to use for the API request (e.g., novita, cerebras, etc.) |
| `model`        | string | Yes      | Model to use for chat completions (e.g., deepseek/deepseek-v3-0324)    |
| `maxTokens`    | number | No       | Maximum number of tokens to generate                                   |
| `temperature`  | number | No       | Sampling temperature (0-2). Higher values make output more random      |
| `apiKey`       | string | Yes      | Hugging Face API token                                                 |

**Output**

| Parameter | Type   | Description        |
| --------- | ------ | ------------------ |
| `content` | string | Generated response |
| `model`   | string | Model used         |
| `usage`   | json   | Token usage stats  |

### Notes

* Category: `tools`
* Type: `huggingface`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/huggingface.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
