martin-lechene / laravel-euria
Laravel package for Infomaniak AI Services (Euria) — LLM, Embeddings, Images, Audio, Streaming
v1.0.1
2026-04-29 21:16 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
- illuminate/contracts: ^10.0|^11.0|^12.0|^13.0
- illuminate/http: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- laravel/framework: ^10.0|^11.0|^12.0|^13.0
- laravel/pint: ^1.0
- mockery/mockery: ^1.6
- nunomaduro/larastan: ^2.0|^3.0
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0|^3.0
- pestphp/pest-plugin-laravel: ^2.0|^3.0
- phpstan/phpstan: ^1.10|^2.0
- phpstan/phpstan-phpunit: ^1.3
README
Laravel package for the Infomaniak AI Services (Euria) API — sovereign LLM hosted in Switzerland.
Installation
composer require martin-lechene/laravel-euria
Configuration
Publish the configuration:
php artisan vendor:publish --tag=euria-config
Then configure your .env:
INFOMANIAK_API_TOKEN=your_oauth2_api_token_here INFOMANIAK_AI_BASE_URL=https://api.infomaniak.com/1/ai EURIA_DEFAULT_TEXT_MODEL=mixtral EURIA_DEFAULT_EMBEDDING_MODEL=text-embedding-3-small EURIA_DEFAULT_IMAGE_MODEL=sdxl EURIA_DEFAULT_AUDIO_MODEL=whisper-1 EURIA_TIMEOUT=60 EURIA_IMAGE_FORMAT=square EURIA_EVENTS_ENABLED=true
Quick Usage
use MartinLechene\Euria\EuriaFacade as Euria; // Via Facade $response = Euria::text('Hello Euria!'); echo $response; // Via helper $response = euria()->text('Hello!'); // Override token (multi-tenant) $response = Euria::withToken('tok_org2_xxx')->model('llama-3')->text('Hi'); // Streaming foreach (Euria::stream('Explain digital sovereignty') as $chunk) { echo $chunk; } // Embeddings $embedding = euria()->embed('Text to vectorize')->first(); // Images $imageUrl = euria()->image('An alpine landscape in summer')->first(); // Transcription audio $text = euria()->transcribe('/path/to/audio.mp3');
Agents
class SupportBot implements \MartinLechene\Euria\Contracts\Agent { use \MartinLechene\Euria\Concerns\Promptable; public function instructions(): string { return 'You are a sovereign support assistant hosted in Switzerland.'; } } $response = (new SupportBot)->prompt('How do I cancel my subscription?');
Testing
The package includes EuriaFake for testing without calling the API:
use MartinLechene\Euria\EuriaFacade as Euria; it('generates a text response', function () { $fake = Euria::fake(); $fake->fakeText('Hello from the fake!'); $response = Euria::text('Say hello'); expect((string) $response)->toBe('Hello from the fake!'); $fake->assertTextCalled(1); });
Artisan Commands
php artisan euria:test # Test connection php artisan euria:models # List available models php artisan make:euria-agent # Create a new Agent
Contributing
PRs are welcome! Please run composer quality before submitting.
License
MIT