# Hugging Face Transformers watermark plugin

> A Hugging Face Transformers watermark plugin for Article 50: mark text from generate() in a few lines, then install, configure and verify it.
>
> widar marks AI output for the EU AI Act and California's AI Transparency Act: an invisible watermark and a signed C2PA credential on text, images, audio and video, in one API, by Bynn Intelligence.

Updated December 4, 2026

Next step: [Create a free account](https://widar.com/sign-in?start=free), free in test mode, or [Talk to sales](https://widar.com/contact). An agent signs up and connects from https://widar.com/agent-setup.md.

Documentation index: https://widar.com/llms.txt

Marks the text your Transformers code generates, for EU AI Act Article 50. Prompts and outputs stay on your machines.

## Install, configure, verify

Three steps, in test mode first. Move to a live plugin key when your plan starts.

1. Install: The plugin comes with your widar workspace: widar's sales team provides it. Add it to your Python environment.
2. Configure: Create a plugin key for your system and set it as WIDAR_PLUGIN_KEY where your code runs, then generate through the plugin with the model you already use. A plugin key only fetches and reports for one system, and can never call the rest of the API. widar plugin-keys create --system-id <sys_id>, export WIDAR_PLUGIN_KEY, then widar = Widar(tokenizer) and widar.generate(model, ...) in your Python code.
3. Verify: Generate an answer through the plugin and check it. The finding names your system and your company. widar verifications create answer.txt.

## What a check of an answer shows

An example for Tessera Chat sp. z o.o., an invented company: an answer generated through the plugin, and what a check of it finds.

Prompt: How should I store a sourdough starter over a long weekend?

Answer: Feed it as usual, let it rise for about an hour, then put it in the fridge in a jar with a loose lid. Cold slows the yeast down, so a fed starter keeps for four or five days without another feeding. When you are back, take it out, discard all but a few spoonfuls and feed it twice at room temperature before you bake. A layer of grey liquid on top is normal: pour it off or stir it in.

What a check of this example answer finds: widar watermark found, Tessera Assistant 2 by Tessera Chat sp. z o.o. C2PA credential not checked: plain text carries no credential.

The same check by machine: Save the answer and check it from the CLI, the API or an agent's MCP client. The findings come back as JSON: what was found, who made it and when. widar verifications create answer.txt

- The text is checked and not kept.
- The system's verify page and its API are free to every caller.
- A text with nothing readable gets No mark found. This does not mean a person made it.

## Requirements and model families

What the plugin needs to run, as its version 0.1.0 declares it.

| Component | Version |
| --- | --- |
| Transformers | 4.50 or later |
| Python | 3.9 or later |
| PyTorch | Installed with the plugin |

Model families: Any causal language model Transformers loads for text generation.

Works with:

- Streaming and whole responses
- Many requests in one batch
- Structured output: a JSON schema keeps its structure

## What leaves your servers

The plugin talks to widar's API only, and only about counts and health.

| What | To widar |
| --- | --- |
| Prompts | Never |
| Responses | Never |
| Tokens marked, requests left unmarked and why | Counts, each minute |
| Plugin and engine versions, health | Each minute |
| Your system's keys and policy | From widar, at start and within 15 minutes of a change |

## Get a test plugin key

Create a free account and mark your first response in test mode, or talk to sales about Enterprise and the self-hosted edition.

## Questions about the Hugging Face Transformers plugin

### Do we change how we call generate()?

Call widar.generate(model, ...) with the arguments you pass to generate() today. It returns what generate() returns, with the output marked.

### Does the plugin call widar on every request?

No. It fetches the system's keys and policy when it starts and reports usage counts each minute. A rotated key is in use within 15 minutes.

### Which key does the plugin use?

A plugin key (wd_plg_) made for one system. It fetches and reports for that system only. A full API key does not start the plugin.

### What is left unmarked?

Source code in fenced code blocks, output you declare as machine-only, and output held to a grammar. A JSON schema keeps its structure. Each output left unmarked is counted with the rule that left it.

### What if a server cannot fetch its key?

By default it refuses to serve unmarked answers, and widar sends marking.failed. A policy can let it serve them unmarked instead, counted one by one.

## Hugging Face Transformers in the docs

- [Plugins for text](https://widar.com/docs/mark/plugins) (Markdown: https://widar.com/docs/mark/plugins.md)
- [Classify](https://widar.com/docs/classify) (Markdown: https://widar.com/docs/classify.md)
- [CLI](https://widar.com/docs/cli) (Markdown: https://widar.com/docs/cli.md)

## For agents

What this page answers: A Hugging Face Transformers watermark plugin for Article 50: mark text from generate() in a few lines, then install, configure and verify it.

- Read this page as Markdown: https://widar.com/integrations/hugging-face-transformers.md, or send `Accept: text/markdown` to https://widar.com/integrations/hugging-face-transformers

### Start without a browser

- Sign up by API, no key: `curl -X POST https://api.widar.com/v1/signups -H "Content-Type: application/json" -d '{"email":"you@example.com","workspace_name":"Your company"}'`
- Then send the emailed code: `curl -X POST https://api.widar.com/v1/signups/{signup_id}/verify -H "Content-Type: application/json" -d '{"code":"<the code>"}'`
- Sign in with the CLI (it comes with a widar workspace): `widar auth login`
- Key variable: `WIDAR_API_KEY`
- List installs by API: `curl -X GET https://api.widar.com/v1/installs -H "Authorization: Bearer $WIDAR_API_KEY"`

### List installs by machine

- API: `curl -X GET https://api.widar.com/v1/installs -H "Authorization: Bearer $WIDAR_API_KEY"`
- CLI: `widar installs list`
- MCP tool: `list_installs {}`
- Docs: https://widar.com/docs/installs#list-installs

### Connect

- [Agent setup](https://widar.com/agent-setup.md): One file an agent follows to sign up, connect and mark a first output
- [MCP server](https://widar.com/mcp): Public verification tools with no key, and every account action as a tool under your key, over Streamable HTTP
- [Docs MCP server](https://widar.com/mcp): Search and read the docs, no key
- [OpenAPI](https://api.widar.com/openapi.json): Every API operation, described
- [llms.txt](https://widar.com/llms.txt): The map of this site and the docs
- [API](https://api.widar.com): Bearer key from WIDAR_API_KEY

Page: https://widar.com/integrations/hugging-face-transformers
Markdown: https://widar.com/integrations/hugging-face-transformers.md
Language: en
