# Structure: A Local-First Interview IDE Powered by Gemma 4

> Source: <https://dev.to/intelliot/structure-a-local-first-interview-ide-powered-by-gemma-4-43bh>
> Published: 2026-05-30 19:39:20+00:00

*This is a submission for the Gemma 4 Challenge: Build with Gemma 4*

Structure is a local-first macOS desktop IDE for technical interview practice. It is built with Qt 6 and C++, and it is designed around a simple idea: AI should help you become capable, not just hand you answers.

The app gives you a four-panel practice loop:

Structure has modes for Learn, Interview, Debug, Speedrun, and Review. The model behavior changes with the mode: in Learn mode it can ask Socratic questions and offer progressive hints; in Interview mode it is stricter and concise; in Debug mode it focuses on the first concrete failure; in Review mode it helps turn attempts into durable recall.

The app is intentionally local-first. Code, attempts, review cards, settings, and session history are stored in SQLite on the user's machine. Code execution happens locally through `clang++`

or `python3`

. Gemma 4 runs locally through Ollama, so interview practice can happen without sending code or learning history to a hosted inference API.

Repository:

[https://github.com/intelliot/structure-ide](https://github.com/intelliot/structure-ide)

Local demo path:

```
git clone https://github.com/intelliot/structure-ide.git
cd structure-ide

cmake -S . -B build -DCMAKE_PREFIX_PATH="$(brew --prefix qt)"
cmake --build build

scripts/setup-gemma4-local.sh
open build/Structure.app
```

In the app, the loop is:

I verified the current build with:

```
cmake --build build
ctest --test-dir build --output-on-failure
```

Result:

```
[100%] Built target StructureSmokeTests
1/1 Test #1: smoke ............................   Passed   21.36 sec
100% tests passed, 0 tests failed out of 1
```

The code is here:

[https://github.com/intelliot/structure-ide](https://github.com/intelliot/structure-ide)

Some implementation pieces worth calling out:

`src/ai/LocalLLMClient.cpp`

is the local model client. It supports OpenAI-compatible chat endpoints, but when it detects Ollama on port `11434`

, it switches to Ollama's native `/api/chat`

endpoint so Structure can use streaming, `think=false`

, `keep_alive`

, response budgets, and a warm local model.`src/ai/PromptBuilder.cpp`

builds mode-specific tutoring context and feedback context. It includes the problem statement, local stdin/stdout examples, constraints, expected complexity, visible tests, submitted code, run results, and a response contract.`src/ai/TutorEngine.cpp`

connects the model to the learning workflow. It streams chat and submit feedback, limits long code context safely, and falls back to deterministic local feedback if the model endpoint is unavailable.`scripts/setup-gemma4-local.sh`

installs or starts Ollama, selects a Gemma 4 model profile, pulls the model, warms it, benchmarks it, and updates existing Structure settings.`src/storage/Database.cpp`

keeps the default local model settings stable: endpoint, model name, temperature, token budget, timeout, keep-alive, and startup warmup.The project is licensed under MIT.

Gemma 4 is the tutor and interviewer at the heart of Structure. It is not used as an autocomplete model. It is used after the app has collected the learning context that matters: the problem, the user's code, the local test results, the expected and actual outputs, the selected practice mode, and the user's claimed Big O.

Structure defaults to the small local Gemma 4 path, `gemma4:e2b`

, because the most important UX requirement is responsiveness. In an interview-practice tool, the user asks short questions, requests hints, debugs one failure at a time, and expects feedback while their mental stack is still warm. E2B is the right default because it can stay resident, stream quickly, and preserve the privacy benefits of local inference.

There is also a quality path for larger local hardware. Users can override the model manually, and the setup script can select a larger Gemma 4 model when the machine has enough memory. That makes the model choice intentional instead of one-size-fits-all:

`gemma4:e2b`

for fast local tutoringThe prompt design is deliberately constrained so the model does real, focused work. For submit feedback, Structure tells Gemma 4 to ground every correctness claim in the run summary, compare expected versus actual output when a test fails, echo and judge the submitted complexity, avoid inventing bugs when tests pass, and give concrete C++ craft notes only when useful.

That model use maps directly to the app's goals:

The result is a small desktop practice environment where Gemma 4 helps a developer become faster and more precise at C++ interviews while keeping the code and learning history on their own machine.
