PHPackages                             atlas-php/atlas - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. atlas-php/atlas

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

atlas-php/atlas
===============

A unified AI SDK for Laravel applications.

v3.6.0(3w ago)5345.4k↑25.6%4[1 PRs](https://github.com/atlas-php/atlas/pulls)MITPHPPHP ^8.2CI passing

Since Jan 22Pushed 1w ago2 watchersCompare

[ Source](https://github.com/atlas-php/atlas)[ Packagist](https://packagist.org/packages/atlas-php/atlas)[ RSS](/packages/atlas-php-atlas/feed)WikiDiscussions 3.x Synced 2d ago

READMEChangelog (10)Dependencies (47)Versions (39)Used By (0)

 [ ![Atlas logo](./images/atlas-logo-3.png) ](https://atlasphp.org)

 [![Automated Tests](https://github.com/atlas-php/atlas/workflows/Automated%20Tests/badge.svg)](https://github.com/atlas-php/atlas/actions) [![Code Coverage](https://camo.githubusercontent.com/5d49a5912053d644f77c1ca762b920d07f49ec2ee0d86a1dce4a5643f4ffe28d/68747470733a2f2f636f6465636f762e696f2f67682f61746c61732d7068702f61746c61732f6272616e63682f332e782f67726170682f62616467652e737667)](https://codecov.io/gh/atlas-php/atlas/branch/3.x) [![Total Downloads](https://camo.githubusercontent.com/400a35f2c68f668f9933d51d393c746433f3ad7f7c2ba352a65e6ba3f62045f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61746c61732d7068702f61746c61732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/atlas-php/atlas) [![PHP Version](https://camo.githubusercontent.com/b543b06c10a4acae57f00e7e89a1188d9f86dc1349389fe58762b4e4842cf9d2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/b543b06c10a4acae57f00e7e89a1188d9f86dc1349389fe58762b4e4842cf9d2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d626c75653f7374796c653d666c61742d737175617265) [![Laravel](https://camo.githubusercontent.com/0370a669d9fb360a73fce45b276a99a54ffac5924e09317cdeaf565c369a38a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312532422d6f72616e67653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/0370a669d9fb360a73fce45b276a99a54ffac5924e09317cdeaf565c369a38a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312532422d6f72616e67653f7374796c653d666c61742d737175617265) [![License](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)

 ✨ [**Features**](#-features) · 📚 [**Documentation**](https://atlasphp.org) · 🧪 [**Sandbox &amp; Examples**](#-sandbox) · ⚖️ [**Comparison**](./COMPARISON.md)

🪐 Atlas
=======

[](#-atlas)

**A unified AI SDK for Laravel — agents, tools, and 10 modalities across every major provider.**

One API for OpenAI, Anthropic, Google, xAI, ElevenLabs, and any OpenAI-compatible endpoint — with no external AI dependency. Atlas runs the tool-call loop and adds optional persistence for conversations, tracking, and memory.

> Every provider modality is **live-tested against real provider APIs**. See the [API Audit](./AUDIT.md).

⚡ It's this simple
------------------

[](#-its-this-simple)

```
use Atlasphp\Atlas\Atlas;

$response = Atlas::text('openai', 'gpt-4o-mini')
    ->message('Draft a brief, friendly email letting a client know their project is running two days behind, and propose Thursday for delivery.')
    ->asText();

echo $response->text;
//  Hi Jordan — a quick heads-up that we're running about two days behind
//  on the project. We're aiming to have everything to you by Thursday..."
```

No agent classes, no config. Add `->instructions()` and `->withTools()` when you need them, or graduate to a reusable [Agent](#define-an-agent) as your app grows.

🎯 Highlights
------------

[](#-highlights)

- **Every modality** — text, images, audio, music, SFX, video, realtime voice, embeddings, reranking, moderation. Voice, music, SFX, and video are Atlas-only.
- **A real agent framework** — first-class agents, sub-agents with guards and true parallel fan-out, auditable execution trees.
- **Production-grade persistence** — conversation memory, execution tracking, retry &amp; branch, media assets on disk (S3/local).
- **Operational services** — pre-flight token counting, provider-call observability, runtime model/voice discovery.
- **Control at every layer** — middleware across agent, step, tool, and provider boundaries.
- **Multi-provider, one API** — every major provider plus any OpenAI-compatible endpoint; swap by changing a string.

💡 Why Atlas?
------------

[](#-why-atlas)

Plenty of AI libraries get you a response and stop there. Atlas handles everything after the happy path — the retries, errors, and tracking real apps run into.

- **Tested for real, not mocked.** Every modality runs against the live provider API ([API Audit](./AUDIT.md)), and every feature ships with automated tests. What the docs say is what ships.
- **Production-hardened.** Automatic retries, typed exceptions, observability, and cost tracking that survives interrupted streams — the failure modes real apps hit are already handled.
- **Keeps pace with the providers.** New models, tools, and capabilities land fast — the [CHANGELOG](./CHANGELOG.md) shows the cadence.

And where it counts, Atlas simply does more: realtime voice, video, retry &amp; branch, pre-flight token counting, and ~50%-cheaper batch processing are all Atlas-only among Laravel AI libraries. **[See the full comparison →](./COMPARISON.md)**

🚀 Quick Start
-------------

[](#-quick-start)

```
composer require atlas-php/atlas
```

Supports Laravel 11+.

```
php artisan vendor:publish --tag=atlas-config
```

### Define an Agent

[](#define-an-agent)

```
use Atlasphp\Atlas\Agent;

class PlantShopAgent extends Agent
{
    public function provider(): ?string
    {
        return 'anthropic';
    }

    public function model(): ?string
    {
        return 'claude-sonnet-4-20250514';
    }

    public function instructions(): ?string
    {
        return orders->find($args['order_id']);

        return $order ? $order->toArray() : 'No order found with that ID.';
    }
}
```

### Chat with the Agent

[](#chat-with-the-agent)

```
$response = Atlas::agent('plant-shop')
    ->withVariables([
        'shop_name' => 'Leaf & Co.',
        'customer_name' => 'Sarah',
        'member_since' => '2023',
    ])
    ->message('My monstera arrived with a snapped leaf — order #5512. Can I get a replacement?')
    ->asText();

$response->text;    // "Oh no, Sarah! Let me pull up #5512 for you..."
$response->usage;   // Token usage
$response->steps;   // Tool call loop — lookup_order, then start_return
```

### Speak with the Agent (Voice to Voice)

[](#speak-with-the-agent-voice-to-voice)

```
$session = Atlas::agent('plant-shop')
    ->withVariables([
        'shop_name' => 'Leaf & Co.',
        'customer_name' => 'Sarah',
        'member_since' => '2023',
    ])
    ->asVoice();

return response()->json($session->toClientPayload());
// Returns ephemeral token + connection URL for WebRTC/WebSocket
```

See the [Voice Integration Guide](https://atlasphp.org/guides/voice-integration/) for full setup instructions.

### Optional: Enable Persistence

[](#optional-enable-persistence)

Atlas runs fully stateless by default — no database required. To unlock conversation history, execution tracking, media-asset storage, and retry &amp; branch, publish and run the migrations:

```
php artisan vendor:publish --tag=atlas-migrations
php artisan migrate
```

Then turn it on in `.env`:

```
ATLAS_PERSISTENCE_ENABLED=true
```

That's it — `->for($user)` and `->forConversation($id)` now load and persist history automatically.

✨ Features
----------

[](#-features)

### Core generation

[](#core-generation)

- **Text &amp; structured output** — schema-validated JSON from any provider
- **Streaming** — SSE + Laravel Broadcasting, real-time chunks
- **Tool calling** — typed tools, multi-step loop, concurrent execution
- **Reasoning** — configure, stream, and persist extended thinking
- **Prompt caching** — cache long system prompts to cut cost
- **Token counting** — count input (with tools &amp; images) before sending

### Agent framework

[](#agent-framework)

- **Agents** — provider, model, instructions, and tools in one reusable class
- **Sub-agents** — delegation with depth/cycle guards, lineage, and parallel fan-out
- **Conversations &amp; memory** — multi-turn history, retry &amp; branch, agent memory
- **Execution tracking** — steps, tools, usage, and assets persisted
- **Media assets** — auto-stored to disk (S3/local), linked to messages
- **Middleware** — agent, step, tool, and provider layers
- **Variable interpolation** — `{var}` placeholders resolved at runtime
- **Queues** — async execution with broadcasting and callbacks

### Modalities

[](#modalities)

- **10 modalities** — text, images, audio, music, sound effects, video, voice, embeddings, reranking, moderation
- **Realtime voice** — bidirectional voice conversations with tools
- **Similarity search** — whole-record or chunked embeddings, diff-based re-embedding

### Ecosystem &amp; tooling

[](#ecosystem--tooling)

- **Provider tools** — web search, code interpreter, file search
- **MCP** — composes with [Laravel MCP](https://github.com/laravel/mcp)
- **Provider discovery** — list models/voices, validate keys, inspect capabilities
- **Observability** — trace every provider call, correlation IDs across retries
- **Testing** — full per-modality fakes, no API keys required
- **Custom providers** — OpenAI-compatible endpoints or fully custom drivers

🔌 Providers
-----------

[](#-providers)

Atlas talks to every major provider through one interface. Switch by changing a string — your agents, tools, and middleware stay the same.

**First-party drivers**

OpenAI · Anthropic · Google (Gemini) · xAI (Grok) · ElevenLabs · Cohere · Jina

**Any OpenAI-compatible API**

Ollama · Groq · DeepSeek · Together · OpenRouter · LM Studio · Mistral · Perplexity

📖 Documentation
---------------

[](#-documentation)

**[atlasphp.org](https://atlasphp.org)** — Full guides, API reference, and examples.

- [Getting Started](https://atlasphp.org/getting-started/installation/) — Installation and configuration
- [Agents](https://atlasphp.org/features/agents/) — Define reusable AI configurations
- [Tools](https://atlasphp.org/features/tools/) — Connect agents to your application
- [Sub-agents](https://atlasphp.org/features/sub-agents/) — Agent-to-agent delegation, including concurrent (parallel) fan-out
- [Middleware](https://atlasphp.org/features/middleware/) — Extend with four middleware layers
- [Similarity Search](https://atlasphp.org/features/similarity-search/) — Semantic search over whole-record or chunked embeddings
- [Modalities](https://atlasphp.org/modalities/text/) — Text, images, audio, video, voice, embeddings, and more
- [Conversations](https://atlasphp.org/guides/conversations/) — Multi-turn chat with persistence
- [Voice](https://atlasphp.org/guides/voice-integration/) — Real-time voice conversations
- [Streaming](https://atlasphp.org/guides/streaming/) — SSE and broadcasting
- [Queue](https://atlasphp.org/guides/queue/) — Background execution
- [Testing](https://atlasphp.org/advanced/testing/) — Fakes and assertions

🧪 Sandbox
---------

[](#-sandbox)

A fully functional chat interface demonstrating Atlas agents in action — multi-agent chat, tool calling, conversation memory, and live image/video generation. Built with Vue 3, Tailwind CSS, and a Laravel JSON API.

   [![Switch between multiple agents](./images/sandbox-agents.png)](./images/sandbox-agents.png)
 **Pick from multiple agents** — each with its own model and tools   [![Multi-image input](./images/sandbox-multi-image.png)](./images/sandbox-multi-image.png)
 **Multi-modal input** — attach multiple images in one message     [![Extended thinking in the execution trace](./images/sandbox-thinking.png)](./images/sandbox-thinking.png)
 **Extended thinking** — stream the model's reasoning and inspect it per step   [![Tool call execution trace](./images/sandbox-tool-calls.png)](./images/sandbox-tool-calls.png)
 **Tool calling** — full execution trace with arguments and results     [![Rich Markdown chat](./images/sandbox-text-chat.png)](./images/sandbox-text-chat.png)
 **Streaming Markdown chat** with full execution traces   [![Generate images](./images/sandbox-image-generation.png)](./images/sandbox-image-generation.png)
 **Image generation** rendered inline from a tool call     [![Generate video](./images/sandbox-video-generation.png)](./images/sandbox-video-generation.png)
 **Video generation** that plays right in the thread   [![Edit an uploaded image](./images/sandbox-image-editing.png)](./images/sandbox-image-editing.png)
 **Image editing** — upload a photo and have an agent restyle it     [![Retry and branch responses](./images/sandbox-retry.png)](./images/sandbox-retry.png)
 **Retry &amp; branch** — regenerate any reply and step through versions   [![Realtime voice — listening](./images/sandbox-voice-listening.png)](./images/sandbox-voice-listening.png)
 [![Realtime voice — AI speaking](./images/sandbox-voice-speaking.png)](./images/sandbox-voice-speaking.png)
 **Realtime voice** — live waveform as you speak and as the AI replies  See the [Sandbox README](./sandbox/README.md) for setup instructions and details.

🧹 Testing and Code Quality
--------------------------

[](#-testing-and-code-quality)

Atlas uses several tools to maintain high code quality:

```
composer check
```

ToolPurpose[Pest](https://pestphp.com)Testing framework[Larastan](https://github.com/larastan/larastan)Static analysis[Laravel Pint](https://laravel.com/docs/pint)Code style[API Audit](./AUDIT.md)Every provider modality verified against **real provider APIs**[Codecov](https://codecov.io/gh/atlas-php/atlas/branch/3.x)[![codecov](https://camo.githubusercontent.com/5d49a5912053d644f77c1ca762b920d07f49ec2ee0d86a1dce4a5643f4ffe28d/68747470733a2f2f636f6465636f762e696f2f67682f61746c61732d7068702f61746c61732f6272616e63682f332e782f67726170682f62616467652e737667)](https://codecov.io/gh/atlas-php/atlas/branch/3.x)🤝 Contributing
--------------

[](#-contributing)

We welcome contributions!

Support the community by giving a GitHub star. Thank you!

Please see our [Contributing Guide](.github/CONTRIBUTING.md) for details.

📄 License
---------

[](#-license)

Atlas is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance97

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

32

Last Release

11d ago

Major Versions

v1.5.0 → v2.0.02026-01-25

2.x-dev → v3.0.02026-03-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2489333?v=4)[Tim Marois](/maintainers/timothymarois)[@timothymarois](https://github.com/timothymarois)

---

Top Contributors

[![timothymarois](https://avatars.githubusercontent.com/u/2489333?v=4)](https://github.com/timothymarois "timothymarois (573 commits)")[![ianfortier](https://avatars.githubusercontent.com/u/2520657?v=4)](https://github.com/ianfortier "ianfortier (1 commits)")[![SagarNaliyapara](https://avatars.githubusercontent.com/u/11518462?v=4)](https://github.com/SagarNaliyapara "SagarNaliyapara (1 commits)")

---

Tags

agentic-aiagentsaiai-toolsanthropicatlasgeminilaravellaravel-ai-sdklaravel-packageopenaiprismphp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/atlas-php-atlas/health.svg)

```
[![Health](https://phpackages.com/badges/atlas-php-atlas/health.svg)](https://phpackages.com/packages/atlas-php-atlas)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[illuminate/routing

The Illuminate Routing package.

1419.2M3.0k](/packages/illuminate-routing)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
