Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Ai Ollama Platform

Ai Ollama Platform Laravel Package

symfony/ai-ollama-platform

Symfony AI bridge for the Ollama platform. Connect Symfony AI to Ollama’s chat and embedding APIs, including NDJSON streaming, using Ollama models and Modelfile capabilities. Links to docs, issues, and contributions in the main Symfony AI repo.

View on GitHub
Deep Wiki
Context7

Ollama platform bridge for Symfony AI

Frequently asked questions about Ai Ollama Platform
Can I use symfony/ai-ollama-platform directly in Laravel without Symfony dependencies?
No, this package is Symfony-first and requires abstraction. You’ll need to replace Symfony’s HttpClient with Laravel’s Http facade or Guzzle, and adapt Messenger for Laravel Queues. The core Ollama API abstraction (chat/embeddings/streaming) remains usable with minimal effort.
How do I handle NDJSON streaming in Laravel for real-time chatbots?
Laravel’s synchronous lifecycle may need adjustments. Use Swoole, ReactPHP, or Laravel Queues to process streaming responses asynchronously. For WebSocket-based apps, pair with Laravel Echo/Pusher to broadcast events in real-time.
What Laravel versions support symfony/ai-ollama-platform?
The package targets PHP 8.1+, so Laravel 9+ is recommended. For older versions, manually upgrade dependencies or use Docker with `php:8.1`. Test compatibility with Laravel Pint and PHPStan to catch version-specific issues.
Is there a simpler Laravel-native alternative to this Symfony package?
Yes, consider `olliwood/ollama-php`, a lightweight Laravel-specific client for Ollama’s HTTP API. It avoids Symfony dependencies entirely but lacks advanced features like Modelfile support or structured DeltaInterface outputs.
How do I manage Ollama models (updates, scaling) in a Laravel production environment?
Use Docker/Kubernetes for Ollama infrastructure and implement Laravel Artisan commands to sync models. Cache model metadata in Laravel’s database or Redis. For scaling, leverage Ollama’s native capabilities or integrate with a model registry service.
Can I use this package for multimodal AI (e.g., audio models like gemma:2b) in Laravel?
Yes, but test thoroughly in staging first. The package supports Ollama’s audio capabilities, but Laravel may need custom event listeners or middleware to handle binary data streams. Validate outputs with Laravel’s validation rules or pipes.
How do I replace Symfony’s Messenger component for async tasks in Laravel?
Replace Messenger with Laravel Queues or Horizon. Wrap the package’s async methods in a Laravel Queue job, using `dispatch()` or `dispatchSync()`. For event-driven workflows, emit Laravel events and listen with `Bus::dispatch()`.
Will this package work with Laravel’s service container and dependency injection?
Yes, but you’ll need to bind Symfony services to Laravel interfaces. For example, create a `OllamaClientInterface` and bind it to a Laravel service provider. The Provider abstraction in the package helps isolate dependencies.
How do I handle errors or retries for Ollama API calls in Laravel?
Use Laravel’s HTTP client retry logic or middleware. For example, wrap the Ollama client in a custom middleware that retries failed requests with exponential backoff. Log errors via Laravel’s logging system for observability.
Can I swap Ollama for another LLM provider (e.g., local models, cloud APIs) later?
The Provider abstraction allows backend swapping, but you’ll need Laravel-specific adapters. For example, create a `LocalLLMProvider` interface and implement it for non-Ollama services. Cache model catalogs in Laravel’s database to reduce API calls.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky