Skip to content

Commit 2045733

Browse files
docs: add Hugging Face provider documentation (#281)
1 parent 569e101 commit 2045733

File tree

5 files changed

+105
-6
lines changed

5 files changed

+105
-6
lines changed

docs/providers/huggingface.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
sidebar_label: Hugging Face
3+
description: Connect Roo Code to Hugging Face's inference router for access to open-source LLMs. Choose from multiple inference providers and models like Llama, Mistral, and more.
4+
keywords:
5+
- hugging face
6+
- huggingface
7+
- roo code
8+
- api provider
9+
- open source models
10+
- llama
11+
- mistral
12+
- inference router
13+
- ai models
14+
- inference providers
15+
image: /img/social-share.jpg
16+
---
17+
18+
# Using Hugging Face With Roo Code
19+
20+
Roo Code integrates with the Hugging Face router to provide access to a curated collection of open-source models optimized for code assistance. The integration allows you to choose from multiple inference providers and automatically selects the best available option.
21+
22+
**Website:** [https://huggingface.co/](https://huggingface.co/)
23+
24+
---
25+
26+
## Getting an API Key
27+
28+
1. **Sign Up/Sign In:** Go to [Hugging Face](https://huggingface.co/) and create an account or sign in.
29+
2. **Navigate to Settings:** Click on your profile picture and select "Settings".
30+
3. **Access Tokens:** Go to the "Access Tokens" section in your settings.
31+
4. **Create Token:** Click "New token" and give it a descriptive name (e.g., "Roo Code").
32+
5. **Set Permissions:** Select "Read" permissions (this is sufficient for Roo Code).
33+
6. **Copy Token:** **Important:** Copy the token immediately. Store it securely.
34+
35+
---
36+
37+
## Supported Models
38+
39+
Roo Code displays models from the 'roocode' collection on Hugging Face, which includes curated open-source models optimized for code assistance. The default model is `meta-llama/Llama-3.3-70B-Instruct` if no model is selected.
40+
41+
Available models are dynamically retrieved from the Hugging Face API. The exact list of models may vary based on availability. Both the model and provider dropdowns are searchable, allowing you to quickly find specific options.
42+
43+
---
44+
45+
## Configuration in Roo Code
46+
47+
1. **Open Roo Code Settings:** Click the gear icon (<Codicon name="gear" />) in the Roo Code panel.
48+
2. **Select Provider:** Choose "Hugging Face" from the "API Provider" dropdown.
49+
3. **Enter API Key:** Paste your Hugging Face API token into the "Hugging Face API Key" field.
50+
4. **Select Model:** Choose your desired model from the "Model" dropdown. The dropdown shows the model count and is searchable.
51+
5. **Choose Inference Provider (Optional):** Select a specific inference provider from the dropdown, or leave it on "Auto" (default) to automatically select the best available provider.
52+
53+
---
54+
55+
## Inference Provider Selection
56+
57+
Hugging Face's router connects to multiple inference providers. You can either:
58+
59+
- **Auto Mode (Default):** Automatically selects the best available provider based on model availability and performance
60+
- **Manual Selection:** Choose a specific provider from the dropdown
61+
62+
The dropdown displays the status of each provider:
63+
- `live` - Provider is operational and available
64+
- `staging` - Provider is in testing phase
65+
- `error` - Provider is currently experiencing issues
66+
67+
Provider names are formatted for better readability in the UI (e.g., "sambanova" appears as "SambaNova").
68+
69+
When you select a specific provider, the model capabilities (max tokens, pricing) will update to reflect that provider's specific configuration. Pricing information is only displayed when a specific provider is selected, not in Auto mode.
70+
71+
---
72+
73+
## Model Information Display
74+
75+
For each selected model, Roo Code displays:
76+
77+
- **Max Output:** The maximum number of tokens the model can generate (varies by provider)
78+
- **Pricing:** Cost per million input and output tokens (displayed only when a specific provider is selected)
79+
- **Image Support:** Currently, all models are shown as text-only. This is a Roo Code implementation limitation, not a restriction of the Hugging Face API.
80+
81+
---
82+
83+
## Available Providers
84+
85+
The list of available providers is dynamic and retrieved from the Hugging Face API. Common providers include:
86+
87+
- **Together AI** - High-performance inference platform
88+
- **Fireworks AI** - Fast and scalable model serving
89+
- **DeepInfra** - Cost-effective GPU infrastructure
90+
- **Hyperbolic** - Optimized inference service
91+
- **Cerebras** - Hardware-accelerated inference
92+
93+
*Note: The providers shown above are examples of commonly available options. The actual list may vary.*
94+
95+
---
96+
97+
## Tips and Notes
98+
99+
- **Provider Failover:** When using Auto mode, if the selected provider fails, Hugging Face's infrastructure will automatically try alternative providers
100+
- **Rate Limits:** Different providers may have different rate limits and availability
101+
- **Pricing Variability:** Costs can vary significantly between providers for the same model
102+
- **Model Updates:** The roocode collection is regularly updated with new and improved models

docs/tips-and-tricks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ A collection of quick tips to help you get the most out of Roo Code.
2727
- To manage large files and reduce context/resource usage, adjust the `File read auto-truncate threshold` setting. This setting controls the number of lines read from a file in one batch. Lower values can improve performance when working with very large files, but may require more read operations. You can find this setting in the Roo Code settings under 'Advanced Settings'.
2828
- Set up a keyboard shortcut for the [`roo.acceptInput` command](/features/keyboard-shortcuts) to accept suggestions or submit text input without using the mouse. Perfect for keyboard-focused workflows and reducing hand strain.
2929
- Use **Sticky Models** to assign specialized AI models to different modes (reasoning model for planning, non-reasoning model for coding). Roo automatically switches to each mode's last-used model without manual selection.
30-
- Customize the [context reduction prompt](/features/intelligent-context-condensing#customizing-the-context-reduction-prompt) if you find that for your domain/use case it forgets particular things. You can instruct it to preserve specific types of information that are critical to your workflow.
30+
- Customize the [context reduction prompt](/features/intelligent-context-condensing#customizing-the-context-condensing-prompt) if you find that for your domain/use case it forgets particular things. You can instruct it to preserve specific types of information that are critical to your workflow.

docs/update-notes/v3.16.6.mdx

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/update-notes/v3.24.0.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ We've added support for Hugging Face as a new provider, bringing access to thous
2929
- **Flexible Integration**: Use models hosted on Hugging Face's infrastructure
3030
- **Easy Configuration**: Simple setup process to get started with your preferred models and providers
3131

32-
This opens up Roo Code to the entire Hugging Face ecosystem of open source AI models.
32+
This opens up Roo Code to the entire Hugging Face ecosystem of open source AI models. See our [Hugging Face provider documentation](/providers/huggingface) for setup instructions.
3333

3434
## Diagnostic Controls
3535

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ const sidebars: SidebarsConfig = {
160160
'providers/gemini',
161161
'providers/glama',
162162
'providers/groq',
163+
'providers/huggingface',
163164
'providers/human-relay',
164165
'providers/lmstudio',
165166
'providers/litellm',

0 commit comments

Comments
 (0)