Download the PHP package falahatiali/homa without Composer
On this page you can find all versions of the php package falahatiali/homa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package homa
Homa is a simple and elegant AI assistant package for Laravel applications. Integrate multiple AI providers (OpenAI, Anthropic Claude, and more) with a clean, fluent API. Named after the mythical Persian bird that brings good fortune and wisdom to those it flies over.
โจ Features
- ๐ฆ Simple, Fluent API - Elegant interface inspired by Laravel's design philosophy
- ๐ Multiple AI Providers - Support for OpenAI (GPT-4, GPT-3.5), Anthropic (Claude), Grok, Groq, Google Gemini, and Ollama (local)
- ๐ฌ Conversation Management - Built-in context-aware multi-turn conversations
- โ๏ธ Highly Configurable - Extensive configuration options for every use case
- ๐งช Fully Tested - 70 tests with 135 assertions covering all critical paths
- ๐ฆ Zero Configuration - Works out of the box with sensible defaults
- ๐ฏ Extensible - Easy to add custom AI providers via Factory Pattern
- ๐ Type Safe - Full PHP 8.1+ type hints and return types
- ๐๏ธ SOLID Principles - Clean architecture following best practices
- โก Production Ready - Uses official OpenAI PHP client for reliability
- ๐ Code Quality - PHPStan level 5 + Laravel Pint for consistency
๐ Requirements
- PHP 8.1 or higher
- Laravel 10.x or 11.x
- API keys for your chosen AI provider(s)
๐ฆ Installation
Install the package via Composer:
Publish Configuration (Optional)
This will create a config/homa.php configuration file.
Quick Setup
-
Copy environment file:
-
Add your API keys to
.env: - Start using Homa:
Configure Your API Keys
Copy the example environment file and add your AI provider API keys:
Required Environment Variables:
Get API Keys:
- OpenAI: platform.openai.com/api-keys
- Anthropic: console.anthropic.com
- Grok: console.x.ai
- Groq: console.groq.com
- Gemini: aistudio.google.com/apikey
๐ฅ๏ธ Use Ollama locally (free)
Ollama lets you run models like Llama 3, Mistral, Qwen locally with no API cost.
1) Install Ollama
2) Download and run a model
3) Configure Homa for Ollama
4) Use in code
Best local models (balanced): llama3.1:8b-instruct, mistral:7b-instruct, qwen2.5:7b-instruct, phi3:mini.
Browse models: https://ollama.com/library and curated lists at https://llm-explorer.com/.
๐ Quick Start
Basic Usage
Ask a simple question:
Configure On-The-Fly
Chain configuration methods for custom behavior:
Switch Between Providers
Easily switch between different AI providers:
Custom System Prompts
Set custom system prompts for specialized behavior:
Multi-Turn Conversations
Create context-aware conversations:
Advanced Chat Control
For full control over the conversation, use the chat() method:
Working with Responses
The AIResponse object provides several useful methods:
โ๏ธ Configuration
Configuration File
After publishing the config file, you can customize all aspects in config/homa.php. For environment variables, see .env.example for all available options:
Available Models
OpenAI:
gpt-5- Latest, most advanced modelgpt-5o- Optimized GPT-5 variantgpt-4o- Latest GPT-4 with vision capabilitiesgpt-4o-mini- Smaller, faster GPT-4ogpt-4-turbo- Fast GPT-4 variantgpt-4- Most capable, best for complex tasksgpt-3.5-turbo- Fast and cost-effective
Anthropic:
claude-3-5-sonnet-20241022- Latest, most capableclaude-3-opus-20240229- Most powerful for complex tasksclaude-3-sonnet-20240229- Balanced performanceclaude-3-haiku-20240307- Fastest, most cost-effective
Groq (Ultra-fast inference):
openai/gpt-oss-20b- Large, capable modelopenai/gpt-oss-7b- Smaller, faster modelllama-3.1-70b-versatile- Meta's Llama modelllama-3.1-8b-instant- Fast Llama modelmixtral-8x7b-32768- Mixtral modelgemma-7b-it- Google's Gemma model
Gemini (Google AI with multimodal capabilities):
gemini-2.0-flash-exp- Latest, fastest (experimental)gemini-1.5-pro-latest- Most capablegemini-1.5-flash-latest- Balanced speed and capabilitygemini-1.5-pro- Stable pro modelgemini-1.5-flash- Fast and efficientgemini-1.5-pro-002- Versioned pro modelgemini-1.5-flash-002- Versioned flash model
๐ฏ Use Cases
Content Generation
Code Assistance
Customer Support Bot
Data Analysis
๐๏ธ Architecture
Package Structure
Adding Custom Providers
You can extend Homa with custom AI providers by implementing the AIProviderInterface:
๐งช Testing
Run the test suite:
Or with PHPUnit directly:
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ Changelog
Please see CHANGELOG for more information on what has changed recently.
๐ Security
If you discover any security-related issues, please email the maintainer instead of using the issue tracker.
๐ License
The MIT License (MIT). Please see License File for more information.
๐ Credits
- Author: Ali Falahati
- Inspired by: The mythical Persian Homa bird, a symbol of wisdom and good fortune
๐ About Homa
In Persian mythology, the Homa (also spelled Huma) is a legendary bird that brings good fortune and wisdom to those fortunate enough to be graced by its shadow. The bird is said to never land, continuously soaring through the skies, much like how this package aims to elevate your Laravel applications with the power of AI.
Just as the Homa bird is known for its wisdom and grace, this package strives to bring intelligent, elegant solutions to your AI integration needs, making it effortless to incorporate cutting-edge AI capabilities into your Laravel applications.
All versions of homa with dependencies
ext-curl Version *
illuminate/support Version ^10.0|^11.0|^12.0
openai-php/laravel Version ^0.16.0
grok-php/client Version ^1.3
google-gemini-php/client Version ^2.6