labsllm / llm-wrapper
PHP library that integrates different LLM services (ChatGPT, Claude, Gemini) into a single wrapper
Installs: 381
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/labsllm/llm-wrapper
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.8
- openai-php/client: ^v0.13.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2026-01-18 03:36:57 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 | Anthropic | |
|---|---|---|---|
| Text Prompts | ✅ | ✅ | 📅 |
| System Instructions | ✅ | ✅ | 📅 |
| Chat | ✅ | ✅ | 📅 |
| Tools/Functions | ✅ | ✅ | ❌ |
| Structure Output | ✅ | ✅ | ❌ |
| Streaming | ✅ | ✅ | ❌ |
| Embeddings | 📅 | ❌ | ❌ |
| Voice | 📅 | ❌ | ❌ |
| Image Generation | 📅 | ❌ | 📅 |