Skip to main content
It provides variable interpolation, performance tracking, A/B testing, and optional seamless integration with the Laravel AI SDK.

Quick start

Get up and running with Deck in minutes.

Installation guide

Install, configure, and verify Deck in your Laravel project.

Quick usage

Creating a prompt

After installing (installation guide), use the Artisan command to create a versioned prompt:
This creates the following structure:
Edit resources/prompts/order-summary/v1/system.md with your prompt content. Use {{ $variable }} syntax for dynamic values:

Using a prompt

Load and render prompts with the Deck facade:

Versioning

Create a new version of an existing prompt:
Activate a specific version:
Or load a specific version programmatically:

Laravel AI SDK integration

If you use the Laravel AI SDK, add the HasPromptTemplate trait to your agents. This way, you do not need to define the instructions() method as it is provided automatically.
Running make:agent will also auto-scaffold a matching prompt directory.

Key features

Versioned prompts

Store prompts as files on disk with directory-based versioning. Load, render, and switch between versions effortlessly.

Prompt generator

Scaffold versioned, role-based prompt structures with the make:prompt Artisan command.

Variable interpolation

Use {{ $variable }} syntax in prompt templates for dynamic content rendering.

AI API messages

Convert prompts to messages arrays ready for OpenAI, Anthropic, and other chat-completion APIs.

Laravel AI SDK

First-class integration with Laravel AI SDK — auto-scaffolding, traits, and middleware.

Performance tracking

Log executions with token usage, latency, cost, and feedback for A/B testing and monitoring.

Explore the docs

Configuration

Customise caching, tracking, and file settings.

Artisan commands

Five commands for managing prompts from the CLI.

Testing

Strategies and examples for testing prompts.