Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

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
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
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
PhpStorm logo

PhpStorm

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

PhpStorm
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media