Download the PHP package symfony/ai-hugging-face-platform without Composer
On this page you can find all versions of the php package symfony/ai-hugging-face-platform. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download symfony/ai-hugging-face-platform
More information about symfony/ai-hugging-face-platform
Files in symfony/ai-hugging-face-platform
Package ai-hugging-face-platform
Short Description HuggingFace platform bridge for Symfony AI
License MIT
Informations about the package ai-hugging-face-platform
HuggingFace Bridge
The HuggingFace bridge provides integration with Hugging Face Inference Providers, enabling access to thousands of pre-trained models for various AI tasks including natural language processing, computer vision, audio processing, and more.
HuggingFace Documentation
Features
- Multi-Provider Support: Access models through multiple inference providers (HuggingFace Inference, Cerebras, Cohere, Groq, Together, and others)
- Comprehensive Task Support: Support for 40+ different AI tasks including:
- Chat completion and text generation
- Image classification, object detection, and segmentation
- Automatic speech recognition and audio classification
- Text classification, translation, summarization
- Feature extraction and embeddings
- And many more...
- Model Discovery: Built-in API client to discover and query available models
- Flexible Input/Output: Support for text, images, audio, and binary data
- Type-Safe Results: Structured result objects for each task type
Installation
Install the symfony/ai-hugging-face-platform package:
Quick Start
Initialize the Platform
Create a Hugging Face access token with the Make calls to Inference Providers permission and use it as the API key.
The HTTP client is optional; a default client is used when none is provided. Choose a provider that serves the model and task you want to use.
Chat Completion Example
Image Classification Example
Feature Extraction (Embeddings)
Providers
The bridge supports multiple inference providers. For a complete list of available providers and their constants, see
the Provider interface.
Specify a provider when creating the platform:
Supported Tasks
The bridge supports 40+ AI tasks across multiple categories including:
- Natural Language Processing: Chat completion, text generation, classification, translation, summarization, embeddings, and more
- Computer Vision: Image classification, object detection, segmentation, depth estimation, and more
- Audio: Speech recognition, audio classification, text-to-speech, and more
- Multimodal: Visual question answering, document understanding, and more
For the complete list of supported tasks and their constants, see the Task interface.
Model Discovery
The bridge includes commands to discover available models without using inference credits. They help to research and use models, and can be registered in a Symfony Console application.
Command-Line Interface
The HuggingFace bridge provides two console commands for model discovery:
List Models
List available models with optional filtering:
Options:
--provider, -p: Filter by inference provider (e.g.,hf-inference)--task, -t: Filter by task type (e.g.,text-generation)--search, -s: Search term to filter models--warm, -w: Only list models with warm inference status (served by an inference provider)
Examples:
Get Model Information
Retrieve detailed information about a specific model:
Examples:
Output includes:
- Model ID, downloads, and community likes
- Task type (pipeline tag)
- Whether the model has warm inference status (served by an inference provider); an absent status does not indicate a cold model
- Inference provider mappings and availability
Options and Configuration
When invoking the platform, you can pass task-specific options:
You can also override the provider per request:
All versions of ai-hugging-face-platform with dependencies
symfony/ai-generic-platform Version ^1.0
symfony/ai-platform Version ^1.0
symfony/console Version ^7.3|^8.0
symfony/http-client Version ^7.3|^8.0