134 Downloads Updated 2 weeks ago
ollama run mukunthpr/gemma4-e4b-code
Updated 2 weeks ago
2 weeks ago
1922c6e7dcbd · 9.6GB ·
Gemma 4 E4B Code
A coding-focused Ollama variant of Gemma 4 E4B, designed for software development, debugging, code review, refactoring, testing, and agent-style coding workflows.
ollama run mukunthpr/gemma4-e4b-code
gemma4-e4b-code is a Modelfile-based coding variant of the existing Gemma 4 E4B model. It does not claim new trained weights or a new fine-tune. The coding behavior comes from the model configuration, system prompt, and runtime settings.
It is intended to be a strong general-purpose local coding assistant while remaining practical on consumer hardware, including Apple Silicon Macs.
The system prompt is tuned to prioritize:
Gemma 4 E4B supports long-context workloads. This variant uses runtime context sizing rather than trying to force one maximum configuration onto every computer.
The included adaptive runtime selects a context profile based on installed system memory and launches the same model with appropriate Ollama runtime settings.
The default profiles are:
| System memory | Default context |
|---|---|
| 16 GB | 32K |
| 24 GB | 48K |
| 32 GB | 64K |
| 48 GB | 96K |
| 64+ GB | 128K |
These are starting profiles, not hard hardware requirements. Actual performance depends on macOS, other running applications, model loading state, and the rest of the Ollama configuration.
The runtime file optimises the model for your specfic hardware The runtime is distributed separately from the model because a static Ollama model definition cannot inspect the host machine’s available memory and change its own context dynamically. Run it using the following series of commands immediately after pulling the model from Ollama.
curl -fsSL https://raw.githubusercontent.com/mukunthpr-dev/gemma4-e4b-code/main/run-gemma4-code-mac.sh -o run-gemma4-code-mac.sh
chmod +x run-gemma4-code-mac.sh
./run-gemma4-code-mac.sh
This will optimize the downloaded model to your specific hardware, using the above listed profiles and turn on a few settings automatically for optimization.
Create a small FastAPI service with typed request/response models,
SQLite persistence, pytest tests, and a clean project structure.
Show every file needed to run it.
Here is the error and the relevant code. Identify the root cause,
explain why it happens, and give the smallest correct fix.
Refactor this module for readability and testability without changing
its public API. Return the revised code and explain the important changes.
Review this pull request for correctness, edge cases, maintainability,
and likely regressions. Prioritize concrete findings over style comments.
This model is aimed at:
This is a local model intended to run through Ollama. Apple Silicon Macs are a primary target for the included adaptive macOS runtime, but the published model itself is not restricted to Macs.
For memory-constrained systems, a smaller context is generally more practical than forcing the maximum context size. For larger-memory systems, the runtime can select a larger context profile.
This variant is derived from Gemma 4 E4B. Please review and comply with the upstream Gemma terms and the terms of any software or code used with the model before redistribution or deployment.
Useful feedback includes:
This project is focused on making a practical, hardware-aware coding experience around Gemma 4 E4B through Ollama.