The program is designed with clear module boundaries: 1) gemini-core.js
Handling core model interactions; 2) openai-api-server.js
Implement API protocol conversion; 3) auth
Modules manage the authentication process independently. This architecture allows organizations to quickly extend middleware functionality such as caching, filtering, etc.
Typical examples of secondary development include: 1) integrating Redis cache to reduce the cost of duplicate queries; 2) adding sensitive word filtering module to meet compliance requirements; 3) developing monitoring plug-ins to interface with Prometheus. there are already seven well-known derivative projects in the open source community, which proves that the scalability of its architecture reaches the industrial-grade standard.
This answer comes from the articleGemini-CLI-2-API: Converting the Gemini CLI to an OpenAI-compatible Native API ServiceThe