Title: AI Provider for Hugging Face
Author: Aslam Doctor
Published: <strong>8. April 2026</strong>
Last modified: 14. April 2026

---

Search plugins

![](https://ps.w.org/ai-provider-for-hugging-face/assets/banner-772x250.png?rev=
3501889)

![](https://ps.w.org/ai-provider-for-hugging-face/assets/icon-256x256.png?rev=3501889)

# AI Provider for Hugging Face

 By [Aslam Doctor](https://profiles.wordpress.org/aslamdoctor/)

[Download](https://downloads.wordpress.org/plugin/ai-provider-for-hugging-face.1.1.0.zip)

 * [Details](https://de-ch.wordpress.org/plugins/ai-provider-for-hugging-face/#description)
 * [Reviews](https://de-ch.wordpress.org/plugins/ai-provider-for-hugging-face/#reviews)
 *  [Installation](https://de-ch.wordpress.org/plugins/ai-provider-for-hugging-face/#installation)
 * [Development](https://de-ch.wordpress.org/plugins/ai-provider-for-hugging-face/#developers)

 [Support](https://wordpress.org/support/plugin/ai-provider-for-hugging-face/)

## Description

This plugin registers Hugging Face as an AI provider for the WordPress AI Client
introduced in WordPress 7.0. It enables text and image generation through Hugging
Face’s Inference API using popular open-source models.

**Features:**

 * Registers Hugging Face on the Settings > Connectors admin screen
 * Supports API key management (environment variable, PHP constant, or database)
 * Text generation via `wp_ai_client_prompt()`
 * Image generation via `wp_ai_client_prompt()->generate_image()`
 * Dynamically fetches top 20 popular models from HuggingFace (updated every 12 
   hours)
 * Multi-provider support — automatically routes to the best available inference
   provider (hf-inference, fal-ai, replicate, together, nscale, wavespeed)
 * Add custom models from the Settings > Hugging Face admin page
 * Extensible model lists via `hugging_face_ai_provider_models` and `hugging_face_ai_provider_image_models`
   filters
 * Configurable base URL for self-hosted TGI instances
 * Clear, actionable error messages for common API issues

**Usage:**

    ```
    $result = wp_ai_client_prompt( 'Summarize the benefits of caching.' )
        ->using_temperature( 0.7 )
        ->generate_text();

    // Generate an image
    $image = wp_ai_client_prompt( 'A futuristic WordPress logo in neon colors' )
        ->generate_image();
    ```

### External Services

This plugin connects to the Hugging Face Inference API to provide AI-powered text
and image generation capabilities within WordPress. The Hugging Face Inference API
is a third-party service operated by Hugging Face, Inc.

#### What data is sent and when

 * Your Hugging Face API key is sent with every request for authentication.
 * When fetching the model list, a request is sent to the Hugging Face API to retrieve
   available models.
 * When generating text, your prompt and any conversation context are sent to the
   Hugging Face Inference API.
 * When generating images, your text prompt is sent to the Hugging Face Inference
   API.
 * When resolving inference providers, a request is sent to the Hugging Face API
   to determine available providers for the selected model.

Data is only sent when the plugin is actively used to generate text or images, or
when loading the model list on the admin settings page.

#### Service links

 * [Hugging Face Website](https://huggingface.co/)
 * [Hugging Face Inference API Documentation](https://huggingface.co/docs/api-inference/)
 * [Hugging Face Terms of Service](https://huggingface.co/terms-of-service)
 * [Hugging Face Privacy Policy](https://huggingface.co/privacy)
 * [Hugging Face Content Policy](https://huggingface.co/content-guidelines)

All API communication is routed through `https://router.huggingface.co` and `https://
huggingface.co/api`.

## Screenshots

[⌊Settings > Connectors screen showing Hugging Face connected with API key.⌉⌊Settings
> Connectors screen showing Hugging Face connected with API key.⌉[

Settings > Connectors screen showing Hugging Face connected with API key.

[⌊Settings > Hugging Face admin page with text and image model configuration.⌉⌊Settings
> Hugging Face admin page with text and image model configuration.⌉[

Settings > Hugging Face admin page with text and image model configuration.

## Installation

 1. Upload the plugin to the `/wp-content/plugins/ai-provider-for-hugging-face` directory.
 2. Activate the plugin through the ‚Plugins‘ menu in WordPress.
 3. Go to [Hugging Face Tokens](https://huggingface.co/settings/tokens) and create 
    a new Access Token with **Read** permission.
 4. Go to Settings > Connectors and enter your Hugging Face API token.

You can also set the API key via environment variable or PHP constant:

    ```
    // Environment variable
    HUGGING_FACE_API_KEY=hf_****

    // PHP constant in wp-config.php
    define( 'HUGGING_FACE_API_KEY', 'hf_****' );
    ```

## FAQ

### Which models are supported?

The plugin dynamically fetches the top 20 most popular text and image generation
models from HuggingFace, updated every 12 hours. You can also add any model via 
the Custom Models field in Settings > Hugging Face, or using the `hugging_face_ai_provider_models`
and `hugging_face_ai_provider_image_models` filters.

### Do I need to pay for HuggingFace?

Models on the free «hf-inference» provider work without credits. Other providers(
fal-ai, replicate, etc.) require pre-paid HuggingFace credits. The plugin automatically
selects the best available provider, preferring the free tier.

### Can I use a self-hosted model?

Yes. Use the `hugging_face_ai_provider_base_url` filter for text generation or `
hugging_face_ai_provider_image_url` filter for image generation to point to your
own inference instance.

### What capabilities are supported?

Text generation and image generation. Video generation support may be added in future
versions.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“AI Provider for Hugging Face” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ Aslam Doctor ](https://profiles.wordpress.org/aslamdoctor/)

“AI Provider for Hugging Face” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/ai-provider-for-hugging-face/contributors)
for their contributions.

[Translate “AI Provider for Hugging Face” into your language.](https://translate.wordpress.org/projects/wp-plugins/ai-provider-for-hugging-face)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/ai-provider-for-hugging-face/),
check out the [SVN repository](https://plugins.svn.wordpress.org/ai-provider-for-hugging-face/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/ai-provider-for-hugging-face/)
by [RSS](https://plugins.trac.wordpress.org/log/ai-provider-for-hugging-face/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.0

 * Fetch models from all HuggingFace inference providers instead of warm-only models.
 * Filter text generation models to chat-compatible (conversational) models only.
 * Show pricing labels in model dropdowns: «Free tier», «from $X.XX/M tokens», or«
   Paid».
 * Models under $0.10/M tokens and hf-inference models are labelled «Free tier».
 * Update fallback model lists with broadly supported models for better reliability.

#### 1.0.0

 * Initial release.
 * Connector registration with API key management.
 * Text generation via Hugging Face Inference API.
 * Image generation via text-to-image models with multi-provider support.
 * Dynamic model lists fetched from HuggingFace API.
 * Admin page with custom model management (add/remove with instant dropdown sync).
 * Clear error messages for 400, 401, 402, 404, 410, 422, 429, 500, 503 API responses.

## Meta

 *  Version **1.1.0**
 *  Last updated **6 Monaten ago**
 *  Active installations **10+**
 *  WordPress version ** 7.0 or higher **
 *  Tested up to **7.0.7**
 *  PHP version ** 7.4 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/ai-provider-for-hugging-face/) und
   [Portuguese (Brazil)](https://br.wordpress.org/plugins/ai-provider-for-hugging-face/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/ai-provider-for-hugging-face)
 * Tags
 * [AI](https://de-ch.wordpress.org/plugins/tags/ai/)[ai client](https://de-ch.wordpress.org/plugins/tags/ai-client/)
   [connectors](https://de-ch.wordpress.org/plugins/tags/connectors/)[image-generation](https://de-ch.wordpress.org/plugins/tags/image-generation/)
 *  [Advanced View](https://de-ch.wordpress.org/plugins/ai-provider-for-hugging-face/advanced/)

## Ratings

Es wurden noch keine Rezensionen eingereicht.

[Your review](https://wordpress.org/support/plugin/ai-provider-for-hugging-face/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/ai-provider-for-hugging-face/reviews/)

## Contributors

 *   [ Aslam Doctor ](https://profiles.wordpress.org/aslamdoctor/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/ai-provider-for-hugging-face/)