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. hocvt/ollama-laravel

ActiveLibrary

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 3w 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

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

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

760d 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

[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[cloudstudio/ollama-laravel

This is my package ollama-laravel

473108.0k](/packages/cloudstudio-ollama-laravel)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

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

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

32837.0k](/packages/sunchayn-nimbus)

PHPackages © 2026

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