symfony / ai-hugging-face-platform
HuggingFace platform bridge for Symfony AI
Package info
github.com/symfony/ai-hugging-face-platform
Type:symfony-ai-platform
pkg:composer/symfony/ai-hugging-face-platform
Requires
- php: >=8.2
- symfony/ai-generic-platform: ^0.15
- symfony/ai-platform: ^0.15
- symfony/console: ^7.3|^8.0
- symfony/http-client: ^7.3|^8.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.5.53
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Hugging Face platform bridge for Symfony AI, built on Hugging Face Inference Providers.
composer require symfony/ai-hugging-face-platform
use Symfony\AI\Platform\Bridge\HuggingFace\Factory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; $platform = Factory::createPlatform('hf_your_api_key_here'); $result = $platform->invoke('openai/gpt-oss-120b', new MessageBag(Message::ofUser('Hello!'))); echo $result->asText();
See the Hugging Face documentation of Symfony AI for chat completion, tool calling, the other tasks and the model catalogs.
Hugging Face Documentation
- Inference Providers overview
- Tasks reference
- Chat completion
- OpenAI-compatible chat completions endpoint
- Function calling
- Hub API: listing models
- Authentication / access tokens
Model Discovery
The ModelListCommand (ai:huggingface:model-list) lists models of the Hugging Face Hub, filtered by
--provider, --task, --search or --warm. The ModelInfoCommand (ai:huggingface:model-info <model-name>)
shows the inference providers of one model. Register both in a Symfony Console application, as in
examples/huggingface/_model.php.