Download the PHP package ursamajeur/laravel-ai-gemini-driver without Composer

On this page you can find all versions of the php package ursamajeur/laravel-ai-gemini-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ai-gemini-driver

Laravel AI Gemini Driver

A Laravel AI provider that proxies Gemini CLI and Antigravity endpoints to access Google's CloudCode-PA v1internal API. Use Gemini, Claude, and GPT models through a single unified interface with automatic rate-limit cascading, multi-endpoint fallback, and SSE streaming.

[!WARNING] Use at Your Own Risk

This package accesses Google's internal CloudCode-PA API through undocumented endpoints using OAuth credentials intended for Gemini CLI. This is not an officially supported method of accessing these models. Using this package may violate Google's Terms of Service and could result in your Google account being suspended or banned. The authors accept no responsibility for any consequences arising from its use.

Requirements

Installation

The service provider is auto-discovered — no manual registration needed.

Publish the configuration file:

Configuration

Authentication

This package requires an OAuth credentials JSON file produced by Gemini CLI. Run Gemini CLI at least once and authenticate — this generates the OAuth JSON that this package uses. The package handles token refresh automatically after that.

Set the path to your OAuth credentials in .env:

If not set, it defaults to storage/cloudcode-pa/oauth_creds.json. The package handles token refresh automatically.

Project ID

The CloudCode-PA project ID is obtained during Gemini CLI onboarding. If not configured, the package will auto-discover it via the loadCodeAssist RPC.

Models

Configure default models via environment variables:

Supported Models

Partner Models

Model Alias
Claude Opus 4 claude-opus-4
Claude Sonnet 4.5 claude-sonnet-4-5
Claude Sonnet 4 claude-sonnet-4
Claude Haiku 4.5 claude-haiku-4-5
GPT-4.1 gpt-4-1
GPT OSS 120B gpt-oss-120b-medium

Gemini Models

Model Alias
Gemini 3 Pro (preview) gemini-3-pro-preview
Gemini 3 Flash (preview) gemini-3-flash-preview
Gemini 2.5 Pro gemini-2.5-pro
Gemini 2.5 Flash gemini-2.5-flash
Gemini 2.5 Flash Lite gemini-2.5-flash-lite
Gemini 2.0 Flash gemini-2.0-flash

You can add custom model aliases in config/cloudcode-pa.php under the models key.

Usage

The provider name is cloudcode-pa. Use it with Laravel AI's standard API:

For the full API (text generation, streaming, multi-turn conversations, reranking), refer to the Laravel AI documentation.

Key Features

Model Cascade (Rate-Limit Fallback)

When a model returns 429 (Rate Limited), the gateway automatically cascades through a configurable fallback chain. Each step tries all configured endpoints before advancing to the next model.

Default cascade: claude-opus-4 → gemini-3-pro-preview → gemini-3-flash-preview → gemini-2.5-pro → gemini-2.5-flash

Cascade only activates when using the default model — explicit model requests use endpoint fallback only.

Customize cascade steps in config/cloudcode-pa.php:

Multi-Endpoint Fallback

Multiple endpoints with independent quota pools are configured by default. On endpoint failure or rate limiting, the next endpoint is tried automatically. Endpoints are customizable in config/cloudcode-pa.php.

Automatic Model Routing

Partner models (Claude, GPT) and Gemini models use different API protocols. The package detects the model type and routes automatically — no configuration needed.

Timeouts

Debug Logging

Enable request/response logging (credentials are always redacted):

Testing

License

MIT


All versions of laravel-ai-gemini-driver with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
laravel/ai Version ^0.1 | ^0.2
saloonphp/laravel-plugin Version ^3.0
saloonphp/saloon Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ursamajeur/laravel-ai-gemini-driver contains the following files

Loading the files please wait ...