Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

elizaOS Vercel AI Gateway Plugin (Python)

Python implementation of the Vercel AI Gateway plugin for elizaOS.

Features

  • Text Generation: TEXT_SMALL, TEXT_LARGE chat completions
  • Embeddings: Vector embeddings generation
  • Images: Image generation and description
  • Structured Output: JSON object generation
  • Streaming: Real-time streaming support

Installation

pip install elizaos-plugin-gateway

Quick Start

import asyncio
from elizaos_plugin_gateway import GatewayPlugin

async def main():
    async with GatewayPlugin() as plugin:
        # Text generation
        response = await plugin.generate_text_large("What is quantum computing?")
        print(response)

        # Embeddings
        embedding = await plugin.create_embedding("Hello, world!")
        print(f"Embedding dimensions: {len(embedding)}")

asyncio.run(main())

Configuration

Set environment variables:

# Required - one of:
export AI_GATEWAY_API_KEY="your-api-key"
export AIGATEWAY_API_KEY="your-api-key"
export VERCEL_OIDC_TOKEN="your-oidc-token"

# Optional
export AI_GATEWAY_BASE_URL="https://ai-gateway.vercel.sh/v1"
export AI_GATEWAY_SMALL_MODEL="gpt-5-mini"
export AI_GATEWAY_LARGE_MODEL="gpt-5"
export AI_GATEWAY_EMBEDDING_MODEL="text-embedding-3-small"

elizaOS Integration

from elizaos_plugin_gateway import get_gateway_plugin

# Get the singleton plugin instance
plugin = get_gateway_plugin()

# Use with AgentRuntime
runtime = AgentRuntime(plugins=[plugin])

API Reference

GatewayPlugin

Text Generation

await plugin.generate_text_small(prompt, system=None, max_tokens=None)
await plugin.generate_text_large(prompt, system=None, max_tokens=None)
await plugin.stream_text(prompt, model=None, system=None)

Embeddings

await plugin.create_embedding(text)

Images

await plugin.generate_image(prompt, n=1, size="1024x1024", quality="standard", style="vivid")
await plugin.describe_image(image_url, prompt=None, max_tokens=8192)

Structured Output

await plugin.generate_object(prompt, model=None, temperature=None)

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy elizaos_plugin_gateway

# Linting
ruff check .
ruff format .

License

MIT

Metadata

Release files for elizaos-plugin-vercel-ai-gateway 2.0.0a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elizaos-plugin-vercel-ai-gateway 2.0.0a4
File Size Uploaded
elizaos_plugin_vercel_ai_gateway-2.0.0a4.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elizaos-plugin-vercel-ai-gateway 2.0.0a4
File Interpreter ABI Platform
elizaos_plugin_vercel_ai_gateway-2.0.0a4-py3-none-any.whl Python 3 none any Details

Total release size: 25.0 kB

Release files / elizaos_plugin_vercel_ai_gateway-2.0.0a4.tar.gz

Download URL elizaos_plugin_vercel_ai_gateway-2.0.0a4.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c9e1f668f9cfc4daa0ed6553c11ae56328a1609351d9b414e98419befe8cb254
BLAKE2b-256 checksum
How to use checksums
66863e47cba3fe179845cadf279bb5f79ca87955e1b90f3f63eee9d29e16bef5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / elizaos_plugin_vercel_ai_gateway-2.0.0a4-py3-none-any.whl

Download URL elizaos_plugin_vercel_ai_gateway-2.0.0a4-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7de73f842dda43e07b4dad55db17eef3ed0e2ecf1aaec0016543d657ce238485
BLAKE2b-256 checksum
How to use checksums
9d0fcc41fb464a3c7c973c6dee83e6214a27c09559ddc1d1242d50a5335f255f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

2.0.0a4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page