PHPackages                             mateffy/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. [API Development](/categories/api)
4. /
5. mateffy/huggingface

ActiveLibrary[API Development](/categories/api)

mateffy/huggingface
===================

An unofficial Huggingface Inference API client for PHP

1.0.5(1y ago)132MITPHP

Since Jan 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Capevace/huggingface-php)[ Packagist](https://packagist.org/packages/mateffy/huggingface)[ RSS](/packages/mateffy-huggingface/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

HuggingFace API client for PHP
==============================

[](#huggingface-api-client-for-php)

A PHP SDK to interact with the HuggingFace API using just a few lines of code.

🧑‍💻 Step 1: Installation
------------------------

[](#‍-step-1-installation)

```
composer require mateffy/huggingface
```

🚀 Step 2: Usage
---------------

[](#-step-2-usage)

```
use Mateffy\HuggingFace;

$token = 'API_TOKEN';

$client = new HuggingFace($token);

$emotions = $client->run(
    model: 'j-hartmann/emotion-english-distilroberta-base',
    input: 'I am happy',
);
/* -> [['label' => 'happy', 'score' => 0.9999], ...] */

/*
 * Shorthand version:
 */

$emotions = HuggingFace::inference(
    token: $token,
    model: 'j-hartmann/emotion-english-distilroberta-base',
    /* Passing a single input will make the response also be a single value */
    input: 'I am happy',
);
/* -> [['label' => 'happy', 'score' => 0.9999], ...] */

/*
 * or with multiple inputs
 */

$result = $client->run(
    model: 'j-hartmann/emotion-english-distilroberta-base',
    /* Multiple inputs will return an array of results */
    inputs: [
        'I am happy',
        'I am sad',
    ]
);
/*
 * -> [
 *      [['label' => 'happy', 'score' => 0.9999], ...]],
 *      [['label' => 'sad', 'score' => 0.9999], ...]],
 * ]
 */
```

Changelog
---------

[](#changelog)

### 1.0.5

[](#105)

- feat: better error handling

### 1.0.4

[](#104)

- feat: better API for single/multiple inputs

### 1.0.3

[](#103)

- fix: added response data as return value

### 1.0.2

[](#102)

- fix: added autoload to composer.json

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

514d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e572442281b0c1b6e8e8f966cc908161a66c4c822e950ff278f8f90dc4f2d2cd?d=identicon)[mateffy](/maintainers/mateffy)

---

Top Contributors

[![Capevace](https://avatars.githubusercontent.com/u/10093858?v=4)](https://github.com/Capevace "Capevace (9 commits)")

### Embed Badge

![Health badge](/badges/mateffy-huggingface/health.svg)

```
[![Health](https://phpackages.com/badges/mateffy-huggingface/health.svg)](https://phpackages.com/packages/mateffy-huggingface)
```

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

806.6M187](/packages/saloonphp-laravel-plugin)[skagarwal/google-places-api

Google Places Api

1903.2M9](/packages/skagarwal-google-places-api)[saloonphp/rate-limit-plugin

Handle rate limits beautifully in your Saloon API integrations or SDKs

211.6M62](/packages/saloonphp-rate-limit-plugin)[myoutdeskllc/salesforce-php

salesforce library for php8+

1574.8k](/packages/myoutdeskllc-salesforce-php)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1122.7k](/packages/codebar-ag-laravel-docuware)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.7k](/packages/codebar-ag-laravel-zammad)

PHPackages © 2026

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