hyperf / odin
Fund package maintenance!
Open Collective
hyperf.wiki/#/zh-cn/donate
Installs: 4 248
Dependents: 0
Suggesters: 0
Security: 0
Stars: 38
Watchers: 6
Forks: 8
Open Issues: 1
Requires
- php: >=8.1
- ext-bcmath: *
- ext-mbstring: *
- aws/aws-sdk-php: ^3.0
- dtyq/php-mcp: 0.1.*
- guzzlehttp/guzzle: ^7.0|^6.0
- hyperf/cache: ~2.2.0 || 3.0.* || 3.1.*
- hyperf/config: ~2.2.0 || 3.0.* || 3.1.*
- hyperf/di: ~2.2.0 || 3.0.* || 3.1.*
- hyperf/logger: ~2.2.0 || 3.0.* || 3.1.*
- hyperf/qdrant-client: *
- hyperf/retry: ~2.2.0 || 3.0.* || 3.1.*
- justinrainbow/json-schema: ^6.3
- yethee/tiktoken: ^0.1.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: >=7.0
- vlucas/phpdotenv: ^5.0
Suggests
- hyperf/engine: Required when using Swoole as the event loop (^2.14).
- hyperf/engine-swow: Required when using Swow as the event loop (^2.12).
- swow/swow: Required to create swow components.
README
English | 中文
Odin
Odin is a PHP-based LLM application development framework. Its naming is inspired by the chief god Odin from Norse mythology and his two ravens Huginn and Muninn, which represent thought and memory respectively. Every morning at dawn, they fly to the human world and return in the evening to bring back what they have seen and heard to Odin. This project aims to help developers create more intelligent and flexible applications using LLM technology, providing more possibilities for LLM technology implementation through a series of powerful and easy-to-use features.
Core Features
- Multi-Model Support: Supports various large language models including OpenAI, Azure OpenAI, AWS Bedrock, Doubao, ChatGLM, and more
- Unified Interface: Provides consistent API interface, simplifying integration with different LLM providers
- Tool Calling: Supports Function Calling, allowing models to invoke custom tools and functions
- MCP Integration: Based on dtyq/php-mcp to implement Model Context Protocol support, easily integrating external tools and services
- Memory Management: Provides flexible memory management system, supporting conversation context persistence
- Vector Storage: Integrates Qdrant vector database, supporting knowledge retrieval and semantic search
- Agent Development: Built-in Agent framework, supporting intelligent agent development
- High Performance: Optimized implementation, supporting streaming responses and efficient processing
System Requirements
- PHP >= 8.0
- PHP Extensions: bcmath, curl, mbstring
- Composer >= 2.0
- Hyperf Framework (2.2.x, 3.0.x or 3.1.x)
Installation
composer require hyperf/odin
Quick Start
- After installation, publish the configuration files:
php bin/hyperf.php vendor:publish hyperf/odin
- Configure your API key in the
.env
file:
OPENAI_API_KEY=your_openai_api_key
- Set the default model in
config/autoload/odin.php
:
return [ 'llm' => [ 'default' => 'gpt-4o', // Set your default model // ... other configurations ], ];
Documentation
Detailed documentation can be found in the doc/user-guide
directory:
- Installation and Configuration
- Core Concepts
- API Reference
- Model Providers
- Tool Development
- Memory Management
- Agent Development
- Example Projects
- MCP Integration
- Frequently Asked Questions
License
Odin is open-sourced software licensed under the MIT license.