hameleon2x/llm-orchestra

PHP LLM client with provider fallback (OpenAI, OpenRouter, Requesty), agent loop with tool calling, typed tool results and PSR-3 logging. Framework-agnostic, no SDK dependencies. PHP 7.4+.

Maintainers

Package info

github.com/Hameleon2x/llm-orchestra

pkg:composer/hameleon2x/llm-orchestra

Statistics

Installs: 13

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.4 2026-05-27 10:59 UTC

This package is auto-updated.

Last update: 2026-05-27 10:59:54 UTC


README

en ru

llm-orchestra

PHP LLM client with provider fallback (OpenAI, OpenRouter, Requesty), an agent loop with tool calling and typed tool results, and PSR-3 logging. Framework-agnostic, no SDK dependencies — uses ext-curl directly.

Install

composer require hameleon2x/llm-orchestra

Minimal example

<?php
require __DIR__ . '/vendor/autoload.php';

use Hameleon2x\Llm\Client;
use Hameleon2x\Llm\Dto\Request;
use Hameleon2x\Llm\Provider\OpenAiProvider;

$client = new Client();
$client->providers = [
    ['class' => OpenAiProvider::class, 'token' => 'sk-...', 'model' => 'gpt-4o-mini'],
];

$response = $client->execute(Request::simple('You are a helpful assistant', 'What is PHP?'));
if ($response->isSuccess()) {
    echo $response->content;
}

Documentation

I want to... Read
Send my first request docs/01-getting-started.md
Configure providers and fallback order docs/02-providers-and-fallback.md
Plug in PSR-3 logging (Monolog, Yii2, etc.) docs/03-logging.md
Write my own tool (function calling) docs/04-tools.md
Run an agent loop (tools + multi-turn) docs/05-toolbox-and-runner.md
Stream events from the agent loop (UI progress, DB logging) docs/06-events.md
See the full doc index docs/README.md

Requirements

  • PHP 7.4+
  • ext-curl, ext-json
  • psr/log ^1.1 || ^2.0 || ^3.0

Versioning

License

MIT — see LICENSE.