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(6d ago)02↓100%MITPHPPHP &gt;=8.1CI failing

Since Mar 19Pushed 4d agoCompare

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

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

39

—

LowBetter than 87% of packages

Maintenance99

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

6d 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

[google/apiclient

Client library for Google APIs

9.8k186.9M907](/packages/google-apiclient)[stripe/stripe-php

Stripe PHP Library

4.0k139.3M422](/packages/stripe-stripe-php)[webonyx/graphql-php

A PHP port of GraphQL reference implementation

4.7k75.4M281](/packages/webonyx-graphql-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k90.6M253](/packages/twilio-sdk)[friendsofsymfony/jsrouting-bundle

A pretty nice way to expose your Symfony routing to client applications.

1.5k52.7M210](/packages/friendsofsymfony-jsrouting-bundle)[knplabs/github-api

GitHub API v3 client

2.2k15.3M173](/packages/knplabs-github-api)

PHPackages © 2026

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