- Learnwithdevopsengineer
- Posts
- Should This Code Deploy? Letting AI Decide
Should This Code Deploy? Letting AI Decide
How I Used a Local LLM to Approve or Block Deploys

π₯ The Problem
Ever pushed a minor config update⦠and waited ages for approval?
Meanwhile, someone drops a risky Friday deploy β and it sails right through.
What if your pipeline could tell the difference?
π οΈ What I Built
A smart CI/CD pipeline that runs 100% locally, powered by a local AI model.
No OpenAI. No cloud. Just GitHub Actions, Python, and Mistral via Ollama.
β Stack:
GitHub Actions β triggers the pipeline
Python script β extracts the commit message and sends it to AI
Mistral LLM (via Ollama) β runs locally and gives a risk score
βοΈ How It Works
1οΈβ£ Push some code β GitHub Actions kicks in
2οΈβ£ It grabs the latest commit message
3οΈβ£ That message is sent to your local Mistral LLM
4οΈβ£ The AI evaluates risk and classifies the commit as:
π’ Low Risk β Auto-deploy
π‘ Medium Risk β Pause + Notify
π΄ High Risk β Block the deploy
All based on the commit message β no hardcoded rules, just natural language understanding.
π‘ Why This Matters
Push a typo fix? It flies through.
Push something shady on a Friday? It gets flagged.
AI becomes your teammate in the pipeline β not just another fancy tool.
π₯ Want the Code?
Subscribe and youβll get instant access in the welcome email:
π learnwithdevopsengineer.beehiiv.com
Or just reply to this post β Iβll send it over personally.