How to use Gemini API key with GitDiagram?

Author: pradyothpnvCreated Aug 28, 2025Updated Sep 15, 2025

Hi @ahmedkhaleel2004,

Thanks for creating GitDiagram! I really like how it helps visualize complex codebases by generating Mermaid.js diagrams using OpenAI models.

I read in the README that most of the prompt engineering and processing happens in /backend/app/prompts.py, and currently, the project uses OpenAI’s o4-mini .

I want to switch to using the Gemini 2.5 Flash API key instead.

Could you please advise:

What changes are required to use the Gemini API key in this project?, Which file(s) or configuration should I update to replace GPT-3 or o4-mini with Gemini?, Any other considerations or recommended approach for integrating Gemini here?

Thanks in advance for your help!

Source: ahmedkhaleel2004/gitdiagram