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.
gemma:2b) for voice-to-text, transcription, or multimodal prompts.symfony/ai; minimal glue code for chat/embeddings.HttpClient) but enables reuse of Ollama’s capabilities.Adopt if:
gemma:2b).Look elsewhere if:
For Executives: *"This package lets us deploy AI locally using Ollama, cutting cloud API costs and improving latency for internal tools. Key wins:
llama3 model—in weeks, not months—with real-time streaming responses.
Risk: Requires Ollama server setup (Docker/managed service), but payback is immediate for cost-sensitive or latency-critical use cases."*For Engineering: *"This is a production-ready Ollama client for Symfony/Laravel, handling:
HttpClient (or Laravel’s Http facade with adapters).gemma:2b for audio tasks via Provider abstraction).gemma:2b for voice-to-text or audio analysis.
Why not build?OllamaClient in a service using Laravel’s Http facade (see example below).// Laravel Service Example
use Symfony\Component\AI\Ollama\OllamaClient;
use Illuminate\Support\Facades\Http;
class OllamaService {
public function __construct() {
$this->client = new OllamaClient(
Http::macro('createClient', fn() => Http::client())
);
}
public function chat(string $model, string $prompt) {
return $this->client->chat($model, $prompt);
}
}
Caveats:
Provider) need Laravel adapters for full feature parity.For Data/ML Teams: *"This package enables local LLM inference for:
nomic-embed-text) for vector search (e.g., Qdrant, Weaviate).structured_output (v0.7.0) to parse LLM responses into JSON/arrays for ML pipelines.
Example: Deploy a local RAG system (Retrieval-Augmented Generation) with Ollama + a vector DB, avoiding cloud API costs.
Limitations:llama3)."*How can I help you explore Laravel packages today?