The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

Ollama Laravel

cloudstudio/ollama-laravel image

Ollama Laravel stats

Downloads
1
Stars
14
Open Issues
0
Forks
1

View on GitHub →

This is my package ollama-laravel

Ollama-Laravel Package

Ollama-Laravel is a Laravel package that provides a seamless integration with the Ollama API. 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.

Installation

composer require cloudstudio/ollama-laravel

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

Basic Usage

use Cloudstudio\Ollama\Facades\Ollama;
 
$response = Ollama::agent('You are a weather expert...')
->prompt('Why is the sky blue?')
->model('llama2')
->options(['temperature' => 0.8])
->stream(false)
->ask();

Show Model Information

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

Copy a Model

Ollama::model('Llama2')->copy('newDestination');

Delete a Model

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

Generate Embeddings

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

Testing

pest

Changelog, Contributing, and Security

Credits

License

MIT License

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Cloudstudio Ollama Laravel Related Articles

Laravel Related Content: Semantic Relationships Using pgvector image

Laravel Related Content: Semantic Relationships Using pgvector

Read article
The Neuron AI Framework for PHP and Laravel image

The Neuron AI Framework for PHP and Laravel

Read article
Laravel AI Chat Starter Kit image

Laravel AI Chat Starter Kit

Read article
Generate Documentation in Laravel with AI image

Generate Documentation in Laravel with AI

Read article
Prism is an AI Package for Laravel image

Prism is an AI Package for Laravel

Read article
Use Ollama LLM Models Locally with Laravel image

Use Ollama LLM Models Locally with Laravel

Read article
Honeybadger logo

Honeybadger

Simple developer-focused application monitoring for Laravel. Error tracking, log management, uptime monitoring, status pages, and more!

Honeybadger
DreamzTech logo

DreamzTech

Hire 6-10+ Yrs. experienced skilled Laravel Developers from DreamzTech. We ensure NDA protected, 100% quality delivery. Contact Us & Discuss Your Need.

DreamzTech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit