Plugins
Overview of the DeepFellow plugin system and built-in plugins.
The plugin system enables dynamic control over request inputs and response outputs at each endpoint.
It works by intercepting requests to and responses from an LLM in order to:
- Check the request body (e.g., to detect abuse).
- Check the request headers (e.g., header manipulations like splitting, injections, smuggling).
- Transform data (e.g., anonymize sensitive data).
- Change the style and tone of the model.
Plugins can be layered and composed to achieve modular and sequential modification of requests in a FIFO (First In, First Out) manner. Each plugin has a priority — the higher the number, the earlier the plugin runs. Priority accepts float values, such as 1.5, so you can insert a plugin between two existing priorities without changing any other plugin's configuration.
To create your own plugin, see Create Plugins.
Plugin configuration (plugins_setup) is a dynamic setting. Change it from the "Plugins Setup" section of the Server Configuration card, or with PUT /admin/config. The change takes effect immediately, without a restart. See Server Configuration.
Managing Plugins in the UI
The DeepFellow Server panel shows all available plugins with their current status. You can see which plugins are enabled and which are disabled at a glance.

Hovering over a plugin shows the endpoints it applies to.

You may also see a df_test_plugin entry in the list. This is an internal development and debugging plugin, disabled by default, and it is not intended for production use.
Example: Abuse Detection and Anonymize Together
This example shows both built-in plugins running on the same request. The following plugins_setup value enables abuse detection with qwen3:1.7b and anonymization for gpt-4.1 and gpt-5:
{ "df_abuse_model": "qwen3:1.7b", "df_anonymize_models": ["gpt-4.1", "gpt-5"] }Send a chat completion request:
curl -X POST 'http://127.0.0.1:8000/v1/chat/completions' \
-H 'accept: application/json' \
-H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Hello!",
"role": "user"
}
],
"model": "gpt-4.1",
"stream": false
}'The server logs show both plugins executing in order — abuse detection first, then anonymization:
INFO: DFAbusePlugin: Abusive level: 0.0
INFO: DFAbusePlugin: Accepted
INFO: DFAnonymizePlugin: Anonymizing request
INFO: DFAnonymizePlugin: Deanonymizing response.
INFO: 127.0.0.1:58918 - "POST /v1/chat/completions HTTP/1.1" 200 OKThe abuse score of 0.0 means the content is clean. The request then passes to the Anonymize plugin, which replaces any PII before forwarding to the model and restores it in the response.
Built-in Plugins
DeepFellow Server ships with two built-in plugins, Abuse Detection and Anonymize, enabled by default and ready to configure. It also ships with two experimental Threat Intelligence plugins, disabled by default. See Threat Intelligence Guards (Experimental) for details.
Abuse Detection
The df_abuse_detection_plugin checks every chat completion and Responses request for abusive content before it reaches the model. It sends the full conversation to a configurable LLM, which returns a score between 0.0 and 1.0. If the score meets or exceeds the configured threshold, the request is rejected with HTTP 422 Unprocessable Entity.
On /v1/responses, the plugin builds the conversation from the instructions and the input. It checks the text of the input string, of message items, and of tool call outputs. It skips images, files, and other items.
Detected content types:
- Hate speech and discriminatory language
- Harassment, bullying, and threatening behavior
- Explicit violence and graphic content
- Sexual harassment and inappropriate sexual content
- Doxxing and malicious sharing of personal information
- Spam and malicious links
- Self-harm and suicide-related content
- Cyberbullying and targeted harassment
- Negative or disparaging content about another person
- Insulting or demeaning poems about a person
Scoring scale:
| Score | Meaning |
|---|---|
| 0.0 – 0.2 | Clean content, no abuse detected |
| 0.3 – 0.4 | Minor concerns, borderline inappropriate |
| 0.5 – 0.6 | Moderate abuse, clearly inappropriate |
| 0.7 – 0.8 | High abuse, severe violations |
| 0.9 – 1.0 | Extreme abuse, immediate action required |
Configuration via the plugins_setup dynamic setting. See Server Configuration.
| Key | Required | Default | Description |
|---|---|---|---|
df_abuse_model | Yes | — | Name of the model used for abuse scoring |
df_abuse_threshold | No | 0.5 | Float threshold above which a request is blocked |
Example configuration:
{ "df_abuse_model": "llama3.1:8b", "df_abuse_threshold": "0.6" }When abuse is detected, the plugin adds the X-PLUGIN-df_abuse_detection_plugin response header with the plugin version.
This plugin runs with priority 100.0 and applies to the /v1/chat/completions and /v1/responses endpoints. It doesn't check requests to /v1/completions, /v1/messages, or /api/chat.
The model set in df_abuse_model must be available in your DeepFellow Infra instance. If the model is unavailable or not configured, abuse detection is silently skipped and all requests pass through.
Anonymize
The df_anonymize_plugin removes personally identifiable information (PII) from messages before they reach the model. It works on /v1/chat/completions and /v1/responses. After the model responds, the plugin restores the original values so your application receives the real data. The process is transparent to both the caller and the model.
Detected entity types:
The plugin uses the spaCy en_core_web_sm model for named entity recognition, and regular expressions for structured patterns.
| Source | Entity types |
|---|---|
| spaCy NER | PERSON, ORG, GPE (countries, cities, states), MONEY, DATE, TIME, PERCENT |
| Regex | EMAIL, PHONE (US format), SOCIAL_SECURITY (SSN: XXX-XX-XXXX) |
Each detected entity is replaced with a numbered token, for example <PERSON_1> or <EMAIL_2>. Tokens are consistent within a single request: the same original value always maps to the same token.
Configuration via the plugins_setup dynamic setting. See Server Configuration.
| Key | Required | Description |
|---|---|---|
df_anonymize_models | Yes | List of model names for which anonymization applies, including their aliases in DeepFellow Infra. Requests to other models are passed through unchanged. |
Example configuration:
{ "df_anonymize_models": ["llama3.1:8b", "mistral:7b"] }Model names:
The plugin reads model names and aliases from GET /v1/models of DeepFellow Infra and matches a request by any name of a listed model:
- An alias works in both directions. If
gpt-4.1has the aliasmy-gpt, listing either name anonymizes requests to both. - A rename hides the original name, so the plugin matches a renamed model only by its new name. List the name that
GET /v1/modelsshows. - If the plugin doesn't know which model a name belongs to, it anonymizes the request. This happens when Infra doesn't serve the name, when Infra is unreachable, or when Infra doesn't report aliases.
- The plugin refreshes model names every 30 seconds. When you move an alias to another model in Infra, the change takes effect within 30 seconds.
To match aliases, the plugin needs a DeepFellow Infra version that reports them in GET /v1/models. With an older Infra, the plugin anonymizes requests to every model that isn't listed in df_anonymize_models.
The plugin supports both streaming and non-streaming responses. It restores the original values in both the response content and the model's reasoning, which the response carries in the reasoning or reasoning_content field. When anonymization occurs, it adds the X-PLUGIN-df_anonymize_plugin response header with the plugin version.
Responses endpoint:
On /v1/responses, the plugin anonymizes the instructions and the input: the input string, the text of message items, function call arguments, and tool call outputs. In function call arguments, it anonymizes only the string values, so the JSON stays valid. It skips images, files, and other items. In the response, it restores the original values in the output text, in the model's reasoning and reasoning summaries, and in function call arguments. It restores them in both streaming and non-streaming responses. If a stream splits a token such as <PERSON_1> across several events, the plugin still restores the original value.
This plugin runs with priority 1 and applies to the /v1/chat/completions and /v1/responses endpoints. It doesn't anonymize requests to /v1/completions, /v1/messages, or /api/chat. It executes after the Abuse Detection plugin on the way in, and before it on the way out.
Threat Intelligence Guards (Experimental)
DeepFellow Server includes two experimental plugins, df_ti_input_guard and df_ti_output_guard, that connect to an external Threat Intelligence service. They belong to the Threat Intelligence capability listed as coming soon in Key Elements, and DeepFellow Server ships both disabled by default.
- The
df_ti_input_guardplugin scans every message the client added in the current turn before it reaches the model. This includes system, developer, and tool messages, tool outputs, the Responsesinstructions, and the Messagessystemprompt. - The
df_ti_output_guardplugin scans the model's response before it reaches the caller.
Each plugin sends the relevant text to a named Threat Intelligence workflow for evaluation. If the workflow reports the content as unsafe, the plugin rejects the request with HTTP 403 Forbidden.
On the Ollama-compatible /api/chat endpoint, a rejected request gets the same error body as on /v1/chat/completions, not the Ollama error format.
On /v1/completions, df_ti_input_guard scans the prompt and the suffix, and df_ti_output_guard scans the text of each item in choices.
The Threat Intelligence workflow evaluates text only. If the prompt of a /v1/completions request contains token IDs, df_ti_input_guard rejects the request with HTTP 403 Forbidden, regardless of ti_fail_open. Send the prompt as a string or a list of strings instead.
The df_ti_output_guard plugin does not send the model's reasoning to the Threat Intelligence workflow. To keep text that the workflow never evaluated away from the caller, the guard removes the reasoning from every response it checks:
- On
/v1/chat/completions, it removes thereasoningandreasoning_contentfields from each message and each streamed delta. - On
/v1/responses, it empties thesummaryandcontentlists of each reasoning item inoutput. In a streamed response, it also drops the reasoning events. - On
/v1/messages, it empties thethinkingfield of eachthinkingblock incontent. In a streamed response, it drops thethinking_deltaevents and empties thethinkingfield of eachcontent_block_startevent. - On
/api/chat, it removes thethinkingfield from the message of the response and of each streamed object. In a streamed response, it also drops the objects that carry onlythinking. The final object, withdone: true, stays in the stream.
A /v1/completions response has no separate reasoning field, so the guard removes nothing from it. If the model writes its reasoning into text, the guard sends it to the Threat Intelligence workflow with the rest of the text.
The guard removes the reasoning even when ti_fail_open is "true" and the Threat Intelligence service is unreachable. If the guard has no API key or no valid ti_url, it checks nothing and the response keeps its reasoning, as the warning later in this section describes.
Enable or disable each guard from the Server panel, the same way you manage Abuse Detection and Anonymize. Both guards use one Threat Intelligence connection, so they read the same ti_url, ti_fail_open, and ti_max_concurrent_checks keys from the plugins_setup dynamic setting. Each guard applies ti_max_concurrent_checks to its own checks. The workflow name is per guard, because Threat Intelligence builds a separate workflow for each one: df_ti_input_guard reads ti_input_workflow_name, and df_ti_output_guard reads ti_output_workflow_name. To change any of these keys, open the DF TI Guard row of Server Configuration, or call PUT /admin/config. The DF TI Guard row has no field for ti_max_concurrent_checks. To set it, edit the Plugins Setup row or call PUT /admin/config. Saving the DF TI Guard row keeps the ti_max_concurrent_checks value. A key you leave unset falls back to the guard's own configuration file, which names the workflow ti_workflow_name in both guards. The new value takes effect on the next request, without a restart.
PUT /admin/config replaces plugins_setup whole. Send every key you want to keep alongside the Threat Intelligence ones, as Setting a Nested Field describes.
| Key | Description |
|---|---|
ti_url | Base URL of the Threat Intelligence service. |
ti_input_workflow_name | Name of the Threat Intelligence workflow that evaluates the prompt df_ti_input_guard scans. |
ti_output_workflow_name | Name of the Threat Intelligence workflow that evaluates the response df_ti_output_guard scans. |
ti_fail_open | When "true", the guard will let the request through if the Threat Intelligence service is unreachable. Any other value, including an empty or misspelled one, will make the guard reject the request. When you leave the key out, the guard uses its own default, false. |
ti_max_concurrent_checks | Maximum number of Threat Intelligence checks that each guard runs at once. When more requests arrive, their checks wait in a queue until a running check finishes. If a check gets no verdict within 30 seconds, including the time in the queue, the guard treats Threat Intelligence as unreachable and applies ti_fail_open. A value that is not a positive whole number falls back to the default, 32. |
ti_api_key | The Threat Intelligence API key. A dynamic secret field, separate from plugins_setup. GET /admin/config returns it masked, so read the plaintext value with GET /admin/config/reveal/ti_api_key. See Reading and Changing Configuration via the API. |
ti_api_key_env, set in the guard's own configuration file, names an environment variable that DeepFellow Server reads as a fallback when ti_api_key is empty. Both guards ship with it set to TI_API_KEY. It is a legacy setting for deployments that configured the guards before dynamic settings existed, and it keeps working unchanged.
A guard starts even without an API key set through ti_api_key or its environment variable fallback. This lets you add the key later from the panel. Until you set a key, an enabled guard logs a warning and lets every request through without a Threat Intelligence check. An empty or malformed ti_url has the same effect, regardless of ti_fail_open, because a broken URL is a configuration error rather than a service outage. Before you enable a guard, set both the API key and the URL.
To check that an enabled guard has a usable Threat Intelligence connection, call GET /plugins and read its status_detail field. The field names the problem, such as a missing API key. It is null when the guard is ready, and always null for a disabled guard.
Both plugins run with priority 2 and apply only to the /v1/chat/completions, /v1/completions, /v1/responses, /v1/messages, and /api/chat endpoints.
These plugins require a separate Threat Intelligence service that DeepFellow does not include yet. Treat them as an early preview, and confirm your Threat Intelligence workflow's behavior before you enable either plugin in a production environment.
We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.