itzmekhokan/ai-provider-for-huggingface
Composer 安装命令:
composer require 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.
README 文档
README
AI Provider for Hugging Face for the WordPress 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
- PHP 7.4+
- WordPress 6.9+ (when used as a plugin)
- The
wordpress/php-ai-clientSDK - A Hugging Face access token from your access tokens page
How it works
The Hugging Face router exposes an OpenAI-compatible API, so this provider is intentionally thin:
| Class | Responsibility |
|---|---|
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
- 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
As a WordPress plugin
Copy this directory into wp-content/plugins/ and activate it alongside the WordPress AI Client.
As a Composer package
composer require itzmekhokan/ai-provider-for-huggingface
Author
License
GPL-2.0-or-later
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-07-05