PHPackages                             jansuchanek/nai - 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. jansuchanek/nai

ActiveLibrary[API Development](/categories/api)

jansuchanek/nai
===============

Multi-provider AI content generation for Nette Framework — Claude, OpenAI, Gemini

v1.0.0(3mo ago)03MITPHPPHP &gt;=8.1CI failing

Since Mar 19Pushed 3mo agoCompare

[ Source](https://github.com/JanSuchanek/nai)[ Packagist](https://packagist.org/packages/jansuchanek/nai)[ RSS](/packages/jansuchanek-nai/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

NAi — Multi-Provider AI Generation for PHP
==========================================

[](#nai--multi-provider-ai-generation-for-php)

Lightweight AI content generator with support for multiple providers. Zero framework dependency in core.

Providers
---------

[](#providers)

- **Claude** (Anthropic) — `claude-sonnet-4-20250514`
- **OpenAI** — `gpt-4o`
- **Gemini** (Google) — `gemini-2.0-flash`

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

[](#installation)

```
composer require jansuchanek/nai
```

Nette Integration
-----------------

[](#nette-integration)

```
extensions:
    ai: NAi\AiExtension

ai:
    provider: claude  # or openai, gemini
    apiKey: %env.ANTHROPIC_API_KEY%
    model: claude-sonnet-4-20250514  # optional
```

Usage
-----

[](#usage)

```
use NAi\AiGeneratorInterface;

final class MyService
{
    public function __construct(
        private AiGeneratorInterface $ai,
    ) {}

    public function generate(): string
    {
        return $this->ai->generate(
            'Napiš popis produktu',
            'Jsi expert na SEO copywriting.',
        );
    }
}
```

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

[](#requirements)

- PHP &gt;= 8.1
- ext-curl

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

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

Unknown

Total

1

Last Release

97d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38ce2f53e74d810d50aca863e1a3b954f34f1629dd01a6a8c7d4d582e7459e63?d=identicon)[JanSuchanek](/maintainers/JanSuchanek)

---

Top Contributors

[![JanSuchanek](https://avatars.githubusercontent.com/u/310020?v=4)](https://github.com/JanSuchanek "JanSuchanek (6 commits)")

### Embed Badge

![Health badge](/badges/jansuchanek-nai/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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