Search by

labsllm / llm-wrapper

HimAndRobot

PHP library that integrates different LLM services (ChatGPT, Claude, Gemini) into a single wrapper

Package info

github.com/HimAndRobot/labsllm

pkg:composer/labsllm/llm-wrapper

Statistics

Installs: 1 895

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 1

v2.5-alpha1.2 2025-12-13 21:27 UTC

README

A simple PHP library that provides a unified interface for interacting with various Large Language Models like OpenAI, Anthropic, and Google.

For complete documentation, visit labsllm.geanpedro.com.br

Install

composer require labsllm/llm-wrapper

Basic Usage

$execute = LabsLLM::text()
    ->using(new OpenAI('SK-***', 'gpt-4o-mini'))
    ->executePrompt('Your question here');

$response = $execute->getResponseData();

echo $response->response;

Switching Providers

Just change the provider in the using() method:

// Using Google
$execute = LabsLLM::text()
    ->using(new Google('API-KEY', 'gemini-pro'))
    ->executePrompt('Your question here');

// Using Anthropic
$execute = LabsLLM::text()
    ->using(new Anthropic('API-KEY', 'claude-3-opus'))
    ->executePrompt('Your question here');

Provider Support Status

Legend:

  • ✅ Supported
  • 🚧 In Development
  • 📅 Planned
  • ❌ Not Supported
Feature OpenAI Google Anthropic
Text Prompts ✅ ✅ 📅
System Instructions ✅ ✅ 📅
Chat ✅ ✅ 📅
Tools/Functions ✅ ✅ ❌
Structure Output ✅ ✅ ❌
Streaming ✅ ✅ ❌
Embeddings 📅 ❌ ❌
Voice 📅 ❌ ❌
Image Generation 📅 ❌ 📅