Use LLMs in your codebase without letting them rewrite your codebase.
LLMs are powerful, but unconstrained generation is dangerous. Glupe is a CLI tool that acts as a strict constraint layer (or firewall) for AI code generation. You write the load-bearing architecture; the AI is only allowed to fill in the explicit blanks.
| Refine | Build | Fix Errors (auto-retry) |
|---|---|---|
![]() |
![]() |
![]() |
Using LLMs for code today looks like this:
- paste prompt β get code β paste into project
- or let an agent rewrite entire files
This creates real issues:
- β no boundaries (AI can change anything)
- β hard to review (what actually changed?)
- β not reproducible
- β easy to break working code
Glupe adds explicit boundaries around AI-generated code.
int add(int a, int b) {
$${
// implement addition
}$$
}- AI can only write inside
$$ { ... } $$ - Everything else is guaranteed unchanged
- You control structure, AI fills implementation
- You write the structure
- AI fills small, isolated regions
- Your codebase stays stable
#include <vector>
void process_data(std::vector<int>& data) {
$${
// 1. Remove negative numbers
// 2. Sort descending
// 3. Remove duplicates
}$$
}glupe main.cpp -fill -localGlupe will:
- extract the container
- send only that part to the LLM
- inject the result back into the file
You can β and for small tasks, you probably should.
Glupe is useful when:
- you care about not touching the rest of the file
- you want repeatable structure
- you want reviewable diffs
- youβre integrating AI into a real codebase
- a constraint layer for LLM code generation
- a way to keep AI edits local and predictable
- a tool for gradual adoption of AI in real projects
- not a new programming language
- not a replacement for compilers
- not deterministic (LLMs are still LLMs)
- not magic β bad prompts still produce bad code
Download the standalone executable for your OS directly from the Releases page.
Note: Piping scripts directly to your shell carries inherent security risks. We recommend using the pre-compiled binaries above, but provide these scripts for convenience. You can review
install.ps1andinstall.shin the repository.
Windows
- Press
Win + R, typecmd, and press Enter. - In the command prompt, type
powershelland press Enter. - Run:
irm https://raw.githubusercontent.com/alonsovm44/glupe/master/install.ps1 | iexLinux/macOS
curl -fsSL https://raw.githubusercontent.com/alonsovm44/glupe/master/install.sh | bashglupe --init
glupe hello.glp -o hello.exe -cpp -local
./hello.exeGlupe is a thin layer between your code and an LLM:
- scans your file
- finds
$$ { ... } $$blocks - sends only those blocks to the model
- injects generated code
- optionally compiles + retries on failure
A major issue with AI code generation is non-determinism: regenerating an app might introduce completely new bugs.
Glupe solves this via caching. Once a $$ block { ... } $$ block successfully compiles and passes your tests, its hash is locked in a .glupe.lock file.
Re-running the CLI will not regenerate that block unless you explicitly change the prompt inside the container. It behaves like incremental compilation: once a block works, it stays frozen safely.
Only touch what you explicitly allow.
EXPORT: "mylib.h"
$$ myfunc { define a function that returns square }$$
EXPORT: END
[Pass 1] Missing include
[Pass 2] Type error
[Pass 3] BUILD SUCCESSFULglupe app.glp -o app.exe -cpp -local -run- developers experimenting with LLM-assisted coding
- people who donβt want AI rewriting entire files
- teams that want controlled integration of AI
- LLM output is still non-deterministic
- requires writing inside containers
- adds an extra step vs raw prompting
This is intentional:
Glupe trades speed for control and safety
glupe config model-local qwen2.5-coder:latestglupe config api-key "YOUR_KEY"
glupe config model-cloud gemini-1.5-flashglupe fix project.c "fix segfault" -localglupe explain main.cpp -cloud englishglupe diff v1.py v2.py -cloudglupe sos english -local "KeyError in pandas"LLMs are useful, but unsafe by default.
Glupeβs goal is simple:
make LLM-assisted programming controllable enough to use in real systems
https://github.com/alonsovm44/glupe/blob/master/.DOCUMENTATION/paper.md
https://github.com/alonsovm44/glupe-tutorial
- Alonso Velazquez (Mexico)
- Krzysztof Dudek (Poland)
MIT License


