Skip to main content

Welcome to Prism Vertex

Prism Vertex is a standalone Google Vertex AI provider for the Prism PHP framework. It gives you access to Google Gemini and partner model families through a single configuration and unified interface.

Quick start

Get started with Prism Vertex in under 5 minutes

Installation

Install and configure the package

What you can do

Prism Vertex supports text generation, structured output, and embeddings across multiple AI providers:

Text generation

Generate text with models from Google, Anthropic, Meta, Mistral, and more:
use Prism\Prism\Prism;
use Prism\Vertex\Enums\Vertex;

$response = Prism::text()
    ->using(Vertex::Gemini, 'gemini-2.5-flash')
    ->withPrompt('Explain quantum computing in simple terms')
    ->asText();

echo $response->text;

Structured output

Get JSON responses that conform to your schema:
use Prism\Prism\Prism;
use Prism\Vertex\Enums\Vertex;
use Prism\Prism\Schema\ObjectSchema;
use Prism\Prism\Schema\StringSchema;

$schema = new ObjectSchema(
    name: 'task',
    description: 'A programming task',
    properties: [
        new StringSchema('title', 'Task title'),
        new StringSchema('description', 'Task description'),
    ]
);

$response = Prism::structured()
    ->using(Vertex::Gemini, 'gemini-2.5-flash')
    ->withSchema($schema)
    ->withPrompt('Create a task for refactoring authentication')
    ->asStructured();

$data = $response->structured;

Embeddings

Generate vector embeddings for semantic search and similarity:
use Prism\Prism\Prism;
use Prism\Vertex\Enums\Vertex;

$response = Prism::embeddings()
    ->using(Vertex::Gemini, 'text-embedding-005')
    ->fromInput('The sky is blue')
    ->asEmbeddings();

$embeddings = $response->embeddings;

Supported providers

Prism Vertex supports 11 different AI providers through a unified interface:

Google Gemini

Native Google models including Gemini 2.5 Flash and text embeddings

Anthropic

Claude 3.5 Sonnet and Haiku models

Mistral

Mistral Small and Codestral models

Meta

Llama 4 Scout and other Meta models

DeepSeek

DeepSeek V3 models

AI21 Labs

Jamba 1.5 Mini and Large

Kimi

Moonshot AI models

MiniMax

MiniMax M1 models

OpenAI

Open-source GPT models

Qwen

Alibaba’s Qwen models

ZAI

Zhipu AI GLM models

Two modes of operation

Prism Vertex supports both Standard and Express modes:

Standard mode

Use your Google Cloud project with full control over location, authentication, and all available models:
'vertex' => [
    'project_id'  => env('VERTEX_PROJECT_ID'),
    'location'    => env('VERTEX_LOCATION', 'us-central1'),
    'credentials' => env('VERTEX_CREDENTIALS'),
],

Express mode

Quick setup with just an API key for Google Gemini models:
'vertex' => [
    'api_key' => env('VERTEX_API_KEY'),
],
Express mode only supports Google Gemini models. Partner models require Standard mode with project_id and location.

Requirements

  • PHP 8.2 or higher
  • Laravel 11 or 12
  • Prism PHP 0.99.16 or higher

Next steps

Install the package

Follow the installation guide to get started

Try the quickstart

Build your first Prism Vertex integration

Build docs developers (and LLMs) love