General Client API to easy access to several LLM APIs (OpenAPI, Ollama, Google Gemini)
composer require tredmann/php-llm-client
use LLM\Enums\Type;
use LLM\LLM;
$llm = LLM::make(Type::Ollama);
echo $llm->completion(
model: 'gemma2:latest',
prompt: 'What is the capital of Germany?',
temperature: 1.0
);
// Output: The capital of Germany is **Berlin**.
- OpenAI (
Type::OpenAI
) - OpenAI Legacy Completion (
Type::OpenAILegacy
) - Ollama (
Type::Ollama
) - Google Gemini (
Type::Gemini
)