Skip to content

General Client API to access several LLM APIs (OpenAPI, Ollama, Google Gemini)

License

Notifications You must be signed in to change notification settings

tredmann/php-llm-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-llm-client

General Client API to easy access to several LLM APIs (OpenAPI, Ollama, Google Gemini)

Installation

composer require tredmann/php-llm-client

Usage

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**.

Supported Providers/LLMs

  • OpenAI (Type::OpenAI)
  • OpenAI Legacy Completion (Type::OpenAILegacy)
  • Ollama (Type::Ollama)
  • Google Gemini (Type::Gemini)

About

General Client API to access several LLM APIs (OpenAPI, Ollama, Google Gemini)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages