PHPackages                             itzmekhokan/ai-provider-for-huggingface - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. itzmekhokan/ai-provider-for-huggingface

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

itzmekhokan/ai-provider-for-huggingface
=======================================

AI Provider for Hugging Face for the PHP AI Client SDK. Works as both a Composer package and WordPress plugin.

00

Since Jun 20Compare

[ Source](https://github.com/itzmekhokan/ai-provider-for-huggingface)[ Packagist](https://packagist.org/packages/itzmekhokan/ai-provider-for-huggingface)[ RSS](/packages/itzmekhokan-ai-provider-for-huggingface/feed)WikiDiscussions Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

AI Provider for Hugging Face
============================

[](#ai-provider-for-hugging-face)

AI Provider for Hugging Face for the [WordPress AI Client](https://github.com/WordPress/php-ai-client). Works as both a Composer package and a WordPress plugin.

This provider registers **Hugging Face** with the AI Client, exposing the open models served through the Hugging Face Inference Providers router (Llama, Qwen, DeepSeek, Mistral, and more) for text generation through Hugging Face's OpenAI-compatible router API.

Requirements
------------

[](#requirements)

- PHP 7.4+
- WordPress 6.9+ (when used as a plugin)
- The [`wordpress/php-ai-client`](https://github.com/WordPress/php-ai-client) SDK
- A Hugging Face access token from your [access tokens](https://huggingface.co/settings/tokens) page

How it works
------------

[](#how-it-works)

The Hugging Face router exposes an OpenAI-compatible API, so this provider is intentionally thin:

ClassResponsibility`Provider\HuggingFaceProvider`Registers the provider, base URL (`https://router.huggingface.co/v1`), API-key auth, and metadata.`Metadata\HuggingFaceModelMetadataDirectory`Lists models from `GET /v1/models` and maps capabilities/options.`Models\HuggingFaceTextGenerationModel`Sends `POST /v1/chat/completions` via the shared OpenAI-compatible base class.Because the router speaks the Chat Completions format, `HuggingFaceTextGenerationModel` extends `AbstractOpenAiCompatibleTextGenerationModel` from the SDK and only overrides request construction.

The Hugging Face router is an aggregator across many inference providers, so the model list reflects whatever chat-capable models the router currently serves. Models are listed alphabetically, with multimodal (image) input enabled for the vision-capable families.

Supported capabilities
----------------------

[](#supported-capabilities)

- Text generation (chat) with open models routed through Hugging Face
- Chat history / multi-turn conversations
- Multimodal (image) input for vision-capable models
- Function calling and JSON / structured output

Installation
------------

[](#installation)

### As a WordPress plugin

[](#as-a-wordpress-plugin)

Copy this directory into `wp-content/plugins/` and activate it alongside the WordPress AI Client.

### As a Composer package

[](#as-a-composer-package)

```
composer require itzmekhokan/ai-provider-for-huggingface
```

Author
------

[](#author)

[Khokan Sardar](https://profiles.wordpress.org/khokansardar/)

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

9

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13062380?v=4)[Khokan Sardar](/maintainers/itzmekhokan)[@itzmekhokan](https://github.com/itzmekhokan)

### Embed Badge

![Health badge](/badges/itzmekhokan-ai-provider-for-huggingface/health.svg)

```
[![Health](https://phpackages.com/badges/itzmekhokan-ai-provider-for-huggingface/health.svg)](https://phpackages.com/packages/itzmekhokan-ai-provider-for-huggingface)
```

###  Alternatives

[badges/poser

Poser, add badges on your readme..

14678.5k13](/packages/badges-poser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
