php-client/ollama
最新稳定版本:v0.1.0
Composer 安装命令:
composer require php-client/ollama
包简介
PHP Client for Ollama API
README 文档
README
This is a PHP client for the Ollama API.
Installation
Install the package via composer:
composer require php-client/ollama
Usage
Simple example:
use PhpClient\Ollama\Ollama; $ollama = new Ollama('http://localhost:11434'); $response = $ollama->generation()->generateCompletion([ 'model' => 'llama3.2:latest', 'prompt' => 'Hello!', // Wait for end of generation before getting response: 'stream' => false, ]); echo $response->json('response');
More information available in comments and PhpDocs in the code.
Also please check the official Ollama API docs.
List of available API actions
- Generation
- Generate completions
- Generate chat completions
- Generate embeddings
- Management
- List local models
- List running models
- Show model information
- Load|Unload model
- Pull|Push model
- Create|Copy|Delete model
- Check blob exists
- Version
License
This package is released under the MIT License.
统计信息
- 总下载量: 55
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-11