承接 php-client/ollama 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-11