q2api  by CassiopeiaCode

Amazon Q API bridge for OpenAI/Claude compatibility

Created 3 months ago
253 stars

Top 99.3% on SourcePulse

GitHubView on GitHub
Project Summary

<2-3 sentences summarising what the project addresses and solves, the target audience, and the benefit.> CassiopeiaCode/q2api bridges Amazon Q Developer to OpenAI and Claude API standards, enabling seamless integration for developers. It offers a unified API layer, supporting multi-account management, load balancing, and streaming responses, simplifying the use of Amazon Q within existing LLM application architectures.

How It Works

The project leverages FastAPI to expose endpoints mimicking OpenAI's Chat Completions and Claude's Messages APIs. It translates requests, manages multiple Amazon Q accounts with automatic token refresh and error-based disabling, and implements random load balancing across active accounts. The architecture supports streaming responses and Claude-style tool use, abstracting Amazon Q's native interface.

Quick Start & Requirements

Deployment is supported via Docker Compose (docker-compose up -d) or local setup requiring Python 3.11+ and dependencies installed via uv or pip. Configuration is managed through a .env file, specifying database connections, API key whitelists (OPENAI_KEYS), and server port. Official API documentation is available at /docs post-startup. Project repositories are on GitHub (https://github.com/CassiopeiaCode/q2api) and Codeberg (https://codeberg.org/Korieu/amazonq2api).

Highlighted Details

  • API Compatibility: Fully implements OpenAI Chat Completions (/v1/chat/completions) and Claude Messages (/v1/messages) APIs, including streaming, tool use, and multimodal content.
  • Multi-Account Management: Robust handling of multiple Amazon Q accounts with automatic token refresh, status monitoring, and threshold-based auto-disabling.
  • Load Balancing & Security: Features random load balancing across enabled accounts and an optional API key whitelist for access control.
  • Persistence & Deployment: Supports SQLite, PostgreSQL, and MySQL for data persistence; offers Docker and local deployment options.

Maintenance & Community

The README does not detail specific contributors, community channels (e.g., Discord, Slack), or roadmap information.

Licensing & Compatibility

The project's license is not specified in the README, which is a critical omission for assessing commercial use or derivative works.

Limitations & Caveats

A previously reported "Tool use infinite loop" issue is noted as fixed in recent versions. The primary caveat is the unspecified license, hindering adoption decisions. Access requires valid Amazon Q Developer credentials.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
22 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.