Download the PHP package cloudstudio/ollama-laravel without Composer
On this page you can find all versions of the php package cloudstudio/ollama-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cloudstudio/ollama-laravel
More information about cloudstudio/ollama-laravel
Files in cloudstudio/ollama-laravel
Package ollama-laravel
Short Description This is my package ollama-laravel
License MIT
Homepage https://github.com/cloudstudio/ollama-laravel
Informations about the package ollama-laravel
Ollama-Laravel Package
Ollama-Laravel is a Laravel package that provides seamless integration with the Ollama API. It enables you to harness the power of local AI models for various tasks including text generation, vision analysis, chat completion, embeddings, and more. This package is perfect for developers looking to integrate AI capabilities into their Laravel applications without relying on external API services.
๐ Features
- Text Generation: Generate content with customizable prompts and models
- Vision Analysis: Analyze images using multimodal models
- Chat Completion: Build conversational AI with message history
- Function Calling: Execute tools and functions through AI
- Streaming Responses: Real-time response streaming
- Model Management: List, copy, delete, and pull models
- Embeddings: Generate vector embeddings for semantic search
- Flexible Configuration: Customizable timeouts, temperature, and more
๐ Requirements
- PHP ^8.2
- Laravel ^11.0
- Ollama server running locally or remotely
If you use Laravel 10.x, please use version V1.0.9
๐ Installation
โ๏ธ Configuration
Publish the configuration file:
Update your .env
file:
Published config file:
๐ Usage Examples
๐ง Basic Text Generation
Simple Question Answering
Content Creation with Custom Options
Code Generation
๐ผ๏ธ Vision Analysis
Basic Image Analysis
Product Catalog Analysis
Multiple Image Comparison
Document OCR and Analysis
๐ฌ Chat Completion
Customer Support Bot
Educational Tutor
Code Review Assistant
php function calculateTotal($items) { $total = 0; foreach($items as $item) { $total += $item["price"] * $item["quantity"]; } return $total; }
๐ง Function Calling / Tools
Weather Information System
Database Query Assistant
๐ Streaming Responses
Real-time Content Generation
Live Chat Implementation
๐ Embeddings for Semantic Search
Document Similarity Search
Product Recommendation System
๐ ๏ธ Model Management
List Available Models
Get Model Information
Copy and Manage Models
๐๏ธ Advanced Use Cases
Content Moderation System
Automated Code Documentation
Multi-language Translation Service
Data Analysis Assistant
๐ฏ Best Practices
1. Model Selection
- Use
llama3.1
for general tasks and reasoning - Use
codellama
for code-related tasks - Use
llava
models for vision tasks - Use
nomic-embed-text
for embeddings
2. Temperature Settings
- 0.1-0.3: Factual, deterministic outputs (code, analysis)
- 0.4-0.7: Balanced creativity and accuracy
- 0.8-1.0: Creative writing, brainstorming
3. Prompt Engineering
4. Error Handling
5. Performance Optimization
๐งช Testing
Run the test suite:
Example test for your AI service:
๐ Changelog, Contributing, and Security
- Changelog
- Contributing
๐๏ธ Credits
๐ License
MIT License
All versions of ollama-laravel with dependencies
guzzlehttp/guzzle Version ^7.8
illuminate/contracts Version ^11.0|^12.0
spatie/laravel-package-tools Version ^1.16