Hugging Face Hub
This section explains how to connect Hugging Face Hub as a Gen AI Model data source in DataDios. A Hugging Face data source powers AI Studio chat and insights, provides embeddings for RAG, browses the models, datasets and spaces your account can see, and can create prompt repositories on the Hub.
Prerequisites
A Hugging Face access token from huggingface.co/settings/tokens.
The token's scope decides what the data source can do — a token that can chat but cannot read repositories produces an empty catalog with no error:
| What you want to do | Token needs |
|---|---|
| Chat / embeddings via the Inference API | Inference access |
| Browse your own models, datasets and spaces | Read access to your repositories |
| Browse an organization's repositories | Read access granted for that organization |
| Create a prompt repository (Add item) | Write access to repositories |
If your network egress is restricted, allow https://huggingface.co (and the Hugging Face CDN it redirects downloads to — *.hf.co / cdn-lfs.huggingface.co). Token counting downloads a tokenizer from there on first use.
Steps to Create and Test a Hugging Face Data Source
Step 1: Create a Data Source
- Navigate to the Data Sources tab in DataDios
- Click + CREATE SOURCE
- In the data source type dropdown, expand Gen AI Models and select Hugging Face Hub
Step 2: Fill Connection Details
- token: Your Hugging Face access token (required, stored encrypted through the secret store)
- huggingface_hub_endpoint: (required)
https://huggingface.coby default. Change it only to point at a self-hosted / dedicated inference endpoint - model_name: (required) The chat model this data source uses:
Qwen/Qwen2-7B-InstructQwen/Qwen2-72B-InstructQwen/Qwen2.5-7B-InstructQwen/Qwen2.5-72B-Instructmistralai/Mixtral-8x22B-Instruct-v0.1— gatedmeta-llama/Meta-Llama-3-8B-Instruct— gatedmeta-llama/Meta-Llama-3-70B-Instruct— gatedHuggingFaceH4/zephyr-7b-beta
- embedding_model: (optional) the model used for vector / RAG operations:
BAAI/bge-small-en-v1.5,BAAI/bge-base-en-v1.5,BAAI/bge-large-en-v1.5
Gated models
The three models marked gated return 403 until the Hugging Face account behind your token has accepted that model's licence on its Hub page. Chat still works once the licence is accepted; until then, requests to the model fail.
A gated model also blocks the tokenizer download DataDios uses to count tokens. When the tokenizer cannot be loaded, DataDios falls back to a characters ÷ 4 estimate instead of an exact count. That estimate is what decides when older messages get trimmed out of a long chat, so a session may be trimmed slightly earlier or later than an exact count would trim it. Accepting the licence removes the fallback.
Custom / self-hosted endpoints
If you set huggingface_hub_endpoint to your own inference endpoint:
- An embedding model cannot be combined with a custom endpoint. DataDios refuses the connection rather than silently sending your text to the public Hub instead. Leave embedding_model empty, or keep the default endpoint.
- model_name is still required, and it is how DataDios knows which model your endpoint serves — it supplies the context-window limit and the tokenizer. Select the model your endpoint actually runs; a mismatch gives the wrong context limit.
JSON Configuration
{
"token": "hf_...",
"huggingface_hub_endpoint": "https://huggingface.co",
"model_name": "HuggingFaceH4/zephyr-7b-beta",
"embedding_model": "BAAI/bge-small-en-v1.5"
}
Step 3: Test Connection
- Click TEST CONNECTION
- A valid token returns Status: OK. The token is never echoed back in any response or log.
The test authenticates against the Hub before reporting success, so an invalid token, an unreachable endpoint or a model that cannot be initialised fails here rather than on your first chat.
Step 4: Save Data Source
- Click CREATE to save the data source
- It appears on the Data Sources listing page under Gen AI Models
Browsing the Hub
Expanding the data source shows three sections — MODELS, DATASETS and SPACES — listing the repositories owned by your account and by every organization your account belongs to. Selecting a repository lists the files it contains; files are fetched when you open the repository rather than all up front.
That is a token scope, not a connection fault. A token with Inference access but no Read access to repositories authenticates successfully and returns an empty catalog with no error. Issue a token with repository read access — and, for an organization's repositories, read access granted for that organization. See Prerequisites.
Creating a prompt repository
Use Add item on the data source row to store a prompt on the Hub.
| Field | Meaning |
|---|---|
| repo_type | The kind of repository to create (dataset) |
| repo_name | Repository name, e.g. team-prompts |
| repo_setting | private (default), org, or public |
| org_name | Required when repo_setting is org — the organization that owns the repository |
| prompt_directory | Directory inside the repository, e.g. prompts |
| prompt_title | File name (without .json), e.g. summarize-tickets |
| prompt | The prompt text |
| description, tags | Optional metadata stored in the file |
| model_name | The model this prompt is written for |
Notes:
orgchooses the namespace only — the repository is still created private. Onlypublicmakes it public.- The prompt is written to
<prompt_directory>/<prompt_title>.jsonin a repository your account owns, with the keysprompt_title,prompt,description,tagsandmodel_name. - If the repository does not exist it is created; an existing file at that path is left untouched.
- Every field marked required above is validated before anything is written, so a mistake in one item of a batch never leaves earlier items half-created on your account.
Using Hugging Face with AI Studio and RAG
Select this data source in AI Studio for chat and insights (see the AI Studio documentation). When an embedding_model is configured, it can also be picked as the embedding source for RAG / hybrid search.
To make it available to every user in your tenant, bind it to the AI · reasoning role under Manage → Integrations → Catalog.
When the connection fails
| What you see | What it usually means | What to check |
|---|---|---|
Test connection fails with an authentication or 401 error | The token is invalid, revoked, or was pasted with whitespace | Reissue the token at huggingface.co/settings/tokens and paste it without surrounding spaces |
| Test connection succeeds, but chat fails with 403 | The model is gated and the account behind the token has not accepted its licence | Open the model's page on the Hub with that account and accept the licence — see Gated models |
| Test connection fails against a custom endpoint | The endpoint is unreachable from the DataDios server, or the model cannot be initialised on it | Confirm the endpoint URL and that the DataDios server can reach it; if egress is restricted, allow https://huggingface.co and *.hf.co |
| The connection is refused when saving, mentioning the embedding model | An embedding model was combined with a custom endpoint, which is not allowed | Clear embedding_model, or return huggingface_hub_endpoint to https://huggingface.co — see Custom / self-hosted endpoints |
| MODELS, DATASETS and SPACES are all empty | The token lacks repository Read access | See Browsing the Hub |
| Token counts look approximate on a gated model | The tokenizer download is blocked, so DataDios estimates at characters ÷ 4 | Accept the model's licence — see Gated models |
Not supported
- SQL editor — Hugging Face Hub is not a queryable source and is not offered in the SQL/Query editor
- Metadata history / schema drift — there is no History tab and no drift schedule for this source
- Cost and workload extraction — per-call LLM usage is still logged under the Hugging Face Hub provider, but batch workload/cost extraction is not implemented
- Fine-tuning and reading file contents from a repository