Proposal: a Rust port of the Laravel AI SDK (laravel-ai-rs)

Open
#799 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
ai, backend

Research direction

Start by reviewing the proposed port at https://github.com/carrot-on-the-horse/laravel-ai-rs and compare its scope with the Rust framework’s conventions. The issue asks whether Laravel wants to adopt it, move it under the Laravel organization, or keep it as a community package; no implementation files or acceptance criteria are named, so first-timer work depends on a maintainer decision.

Written by the indexing model from the issue text.

Description

Hi! Laravel for Rust doesn't have an AI SDK yet, and we rely on laravel/ai heavily, so we ported it:

https://github.com/carrot-on-the-horse/laravel-ai-rs

How it was built. Test-first: every Pest test in laravel/ai was listed, and each has a Rust test with the same name (snake_case) that was written before the code. tools/spec.py status tracks coverage: 3,116 of 3,210 PHP tests are ported and passing. The remaining 94 are documented skips for PHP-only behaviour (subclassing, Eloquent models, serializing closures, console commands), each explained at the top of its test file.

What's covered

  • Agents: tools, structured output, middleware, events, failover, streaming, sub-agents, skills
  • Conversation memory in the database (migrations included), with titles and failed-turn recording
  • Tool approvals: a run pauses on a gated tool and resumes from the caller's decisions
  • Queued and broadcast prompts; Vercel AI SDK data protocol and AG-UI stream responses
  • Embeddings, images, audio, transcription, reranking, classification, files and vector stores
  • Filesystem and MCP tools
  • Fakes and assertions for every operation
  • All 20 drivers: OpenAI, Anthropic, Gemini, Azure OpenAI, Bedrock, Mistral, Groq, xAI, DeepSeek, Cohere, Ollama, OpenRouter, OpenAI-compatible, Open Responses, Laravel Cloud, VoyageAI, Jina, ElevenLabs, TypeSafe

It uses the framework's own HTTP client, so client::fake() plays the role of Http::fake() in the provider tests, and the config reads the same environment variables as config/ai.php.

Live testing. The 70 integration tests are ported as opt-in tests. Agent prompts, streaming, structured output and tools pass against OpenAI, Anthropic and Groq; OpenAI embeddings pass too.

Known gaps

  • No make:agent console commands yet
  • Retries don't wait out a provider's Retry-After delay
  • A queued agent must be serializable, and then/catch callbacks run only in the process that queued it

License: MIT, the same as laravel/ai.

We'd be glad to contribute it as the official package, move it under the Laravel org, or keep it as a community package. Happy to adapt it to whatever conventions you prefer for first-party Rust packages.

Or, if you already have unpublished work in the same direction, I'd be happy to help test it and contribute.

Dominant language
Rust
Stars
847
Forks
174
Avg merge
5h 40m
Merged PRs (30d)
167

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from laravel/rust-framework

All issues in laravel/rust-framework

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.