https://github.com/php-client/ollama
PHP client for Ollama API
https://github.com/php-client/ollama
api client ollama php saloon sdk
Last synced: 4 months ago
JSON representation
PHP client for Ollama API
- Host: GitHub
- URL: https://github.com/php-client/ollama
- Owner: php-client
- License: mit
- Created: 2025-02-10T21:45:57.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-02T15:31:20.000Z (over 1 year ago)
- Last Synced: 2025-11-07T08:24:32.485Z (8 months ago)
- Topics: api, client, ollama, php, saloon, sdk
- Language: PHP
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PHP client for Ollama API.
This is a PHP client for the [Ollama API](https://github.com/ollama/ollama/blob/main/docs/api.md).
## Installation
Install the package via composer:
```bash
composer require php-client/ollama
```
## Usage
Simple example:
```php
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](https://github.com/ollama/ollama/blob/main/docs/api.md).
## 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](LICENSE.md).