Skip to content

Conversation

@jerilynzheng
Copy link
Contributor

Summary

This PR adds native support for Vercel AI Gateway as a first-class backend, providing consistency with other gateway backends like OpenRouter.

Changes

  • Backend Implementation: Added "vercel" to ClientBackend type and implemented in client factory with auto-configured base_url
  • Documentation: Updated all documentation pages to showcase Vercel AI Gateway usage
  • API Consistency: Uses creator/model-name format (e.g., openai/gpt-5.2, anthropic/claude-sonnet-4.5)

Usage

rlm = RLM(
    backend="vercel",
    backend_kwargs={
        "api_key": os.getenv("AI_GATEWAY_API_KEY"),
        "model_name": "openai/gpt-5.2",
    },
)

Testing

  • ✅ Verified basic OpenAI model completion through Vercel
  • ✅ Verified Anthropic model completion through Vercel
  • ✅ Confirmed base_url auto-configuration
  • ✅ Validated cost tracking works correctly

Benefits

  • Simplified API - no manual base_url configuration needed
  • Consistent with openrouter and vllm backends
  • Access to multiple AI providers (OpenAI, Anthropic, Google, etc.) through one gateway

🤖 Generated with Claude Code

- Add "vercel" backend to ClientBackend type definition
- Implement vercel backend in client factory with auto-configured base_url
- Update documentation to use backend="vercel" instead of manual configuration
- Add Vercel AI Gateway to backend table in API docs
- Use creator/model-name format (e.g., openai/gpt-5.2) for model specification
- Simplify examples by removing manual base_url configuration

This provides consistency with other gateway backends like OpenRouter.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant