PHPackages                             hocvt/ollama-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hocvt/ollama-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hocvt/ollama-laravel
====================

This is my package ollama-laravel

v1.1.2(2y ago)1612MITPHPPHP ^8.2

Since May 17Pushed 2y agoCompare

[ Source](https://github.com/vuthaihoc/ollama-laravel)[ Packagist](https://packagist.org/packages/hocvt/ollama-laravel)[ Docs](https://github.com/cloudstudio/ollama-laravel)[ RSS](/packages/hocvt-ollama-laravel/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

Ollama-Laravel Package
======================

[](#ollama-laravel-package)

Ollama-Laravel is a Laravel package that provides a seamless integration with the [Ollama API](https://github.com/jmorganca/ollama). It includes functionalities for model management, prompt generation, format setting, and more. This package is perfect for developers looking to leverage the power of the Ollama API in their Laravel applications.

If you use laravel 10.x, please use the following version V1.0.5
----------------------------------------------------------------

[](#if-you-use-laravel-10x-please-use-the-following-version-v105)

```
https://github.com/cloudstudio/ollama-laravel/releases/tag/v1.0.5
```

Installation
------------

[](#installation)

```
composer require hocvt/ollama-laravel
```

Configuration
-------------

[](#configuration)

```
php artisan vendor:publish --tag="ollama-laravel-config"
```

Published config file:

```
return [
    'model' => env('OLLAMA_MODEL', 'llama2'),
    'url' => env('OLLAMA_URL', 'http://127.0.0.1:11434'),
    'default_prompt' => env('OLLAMA_DEFAULT_PROMPT', 'Hello, how can I assist you today?'),
    'connection' => [
        'timeout' => env('OLLAMA_CONNECTION_TIMEOUT', 300),
    ],
];
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Cloudstudio\Ollama\Facades\Ollama;

$response = Ollama::agent('You are a weather expert...')
    ->prompt('Why is the sky blue?')
    ->model('llama2')
    ->baseUrl('http://127.0.0.1:11434')
    ->options(['temperature' => 0.8])
    ->stream(false)
    ->ask();
```

### Vision Support

[](#vision-support)

```
$response = Ollama::model('llava:13b')
    ->prompt('What is in this picture?')
    ->image(public_path('images/example.jpg'))
    ->ask();

// "The image features a close-up of a person's hand, wearing bright pink fingernail polish and blue nail polish. In addition to the colorful nails, the hand has two tattoos – one is a cross and the other is an eye."
```

### Chat Completion

[](#chat-completion)

```
$messages = [
    ['role' => 'user', 'content' => 'My name is Toni Soriano and I live in Spain'],
    ['role' => 'assistant', 'content' => 'Nice to meet you , Toni Soriano'],
    ['role' => 'user', 'content' => 'where I live ?'],
];

$response = Ollama::agent('You know me really well!')
    ->model('llama2')
    ->chat($messages);

// "You mentioned that you live in Spain."
```

### Show Model Information

[](#show-model-information)

```
$response = Ollama::model('Llama2')->show();
```

### Copy a Model

[](#copy-a-model)

```
Ollama::model('Llama2')->copy('NewModel');
```

### Delete a Model

[](#delete-a-model)

```
Ollama::model('Llama2')->delete();
```

### Generate Embeddings

[](#generate-embeddings)

```
$embeddings = Ollama::model('Llama2')->embeddings('Your prompt here');
```

Testing
-------

[](#testing)

```
pest
```

Changelog, Contributing, and Security
-------------------------------------

[](#changelog-contributing-and-security)

- [Changelog](CHANGELOG.md)
- [Contributing](CONTRIBUTING.md)

Credits
-------

[](#credits)

- [Toni Soriano](https://github.com/cloudstudio)

License
-------

[](#license)

[MIT License](LICENSE.md)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

5

Last Release

805d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2509658?v=4)[Stupid Dev](/maintainers/vuthaihoc)[@vuthaihoc](https://github.com/vuthaihoc)

---

Top Contributors

[![vuthaihoc](https://avatars.githubusercontent.com/u/2509658?v=4)](https://github.com/vuthaihoc "vuthaihoc (6 commits)")[![cloudstudio](https://avatars.githubusercontent.com/u/3589377?v=4)](https://github.com/cloudstudio "cloudstudio (5 commits)")[![Jamonek](https://avatars.githubusercontent.com/u/209572?v=4)](https://github.com/Jamonek "Jamonek (1 commits)")[![marianoarga](https://avatars.githubusercontent.com/u/1138627?v=4)](https://github.com/marianoarga "marianoarga (1 commits)")[![neoteknic](https://avatars.githubusercontent.com/u/1809652?v=4)](https://github.com/neoteknic "neoteknic (1 commits)")

---

Tags

laravelcloudstudioollama-laravel

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/hocvt-ollama-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/hocvt-ollama-laravel/health.svg)](https://phpackages.com/packages/hocvt-ollama-laravel)
```

###  Alternatives

[nativephp/mobile

NativePHP for Mobile

1.1k102.1k137](/packages/nativephp-mobile)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M185](/packages/spatie-laravel-health)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329575.9k33](/packages/codewithdennis-filament-select-tree)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
