A lightweight gRPC + RESTful wrapper for AI models. Built in Go, this service exposes a unified interface for AI generation via both protocol-level gRPC and HTTP/JSON endpoints. Includes Swagger UI, Docker support, and flexible configuration via flags or environment variables.
- β
gRPC service:
AiService.GenAi(prompt) - β
RESTful HTTP endpoint:
POST /v1/genai - β Swagger UI for interactive API testing
- β Docker-ready with multi-port support
- β
Configurable via flags,
.env, or inline environment variables - β Graceful shutdown and signal handling
- β Gemini API key integration
go run main.go --port=8000 --api-key=your_key_here --model=gemini-2.5-proOr use environment variables:
export PORT=8000
export API_KEY=your_key_here
export MODEL=gemini-2.5-pro
go run main.godocker build -t wrapper .Or pull from GitHub Container Registry:
docker pull ghcr.io/imrany/wrapperdocker run -d --name wrapper \
-p 8000:8000 \ # gRPC
-p 8090:8090 \ # REST + Swagger
ghcr.io/imrany/wrapper \
--port=8000 \
--api-key=your_key_here
--model=gemini-2.5-proCreate .env:
PORT=8000
API_KEY="your_key_here"
MODEL="gemini-2.5-pro" # or "gpt-5.1-2025-11-13"Run:
docker run --env-file .env -p 8000:8000 -p 8090:8090 ghcr.io/imrany/wrapperPOST /v1/genai
Content-Type: application/json
Body: "Hello AI"curl -X POST http://localhost:8090/v1/genai \
-H "Content-Type: application/json" \
-d '"Hello AI"'service AiService {
rpc GenAi(GenAiRequest) returns (GenAiResponse);
}grpcurl -insecure localhost:8000 \
wekalist.api.v1.AiService.GenAi \
-d '{"prompt": "Hello AI"}'Visit: http://localhost:8090/swagger/
{
"prompt": "Hello AI",
"response": "Hello! How can I help you today?\n",
"status": null
}| Variable | Description |
|---|---|
PORT |
gRPC server port |
API_KEY |
Gemini API key |
MODEL |
Provides model name, e.g gemini-2.5-pro, gpt-5.1-2025-11-13 |
GET /healthzReturns 200 OK with body ok.
Built by Imran Licensed under MIT