aigw-contrib-add-translator
Installation
SKILL.md
Add a New Translator
Add a new LLM provider translator to Envoy AI Gateway. This is the most common contribution type. A translator converts requests from one API schema (e.g., OpenAI) to another (e.g., AWS Bedrock) and translates responses back.
Before starting: Read aigw-contrib-go-style — performance patterns and JSON handling are the most common reasons translator PRs get rejected.
Phase 1: Understand the Interfaces
Study an existing translator to understand the pattern. Start with a simple one like openai_openai.go (passthrough), then look at a complex one like openai_awsbedrock.go.
Key interfaces your translator must implement:
- Request translation:
(sourceBody []byte) → (targetBody []byte, error) - Response translation:
(targetBody []byte) → (sourceBody []byte, error) - Streaming chunk translation:
(targetChunk []byte) → (sourceChunk []byte, error)
The translator is generic over [ReqT, RespT, RespChunkT] type parameters.