Instructions to use shebxyd/kofu-gemma4-edge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shebxyd/kofu-gemma4-edge with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf shebxyd/kofu-gemma4-edge:Q4_K_M # Run inference directly in the terminal: llama cli -hf shebxyd/kofu-gemma4-edge:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf shebxyd/kofu-gemma4-edge:Q4_K_M # Run inference directly in the terminal: llama cli -hf shebxyd/kofu-gemma4-edge:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf shebxyd/kofu-gemma4-edge:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf shebxyd/kofu-gemma4-edge:Q4_K_M
Use Docker
docker model run hf.co/shebxyd/kofu-gemma4-edge:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use shebxyd/kofu-gemma4-edge with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shebxyd/kofu-gemma4-edge" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shebxyd/kofu-gemma4-edge", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shebxyd/kofu-gemma4-edge:Q4_K_M
- Ollama
How to use shebxyd/kofu-gemma4-edge with Ollama:
ollama run hf.co/shebxyd/kofu-gemma4-edge:Q4_K_M
- Unsloth Desktop
- Pi
How to use shebxyd/kofu-gemma4-edge with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shebxyd/kofu-gemma4-edge:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "shebxyd/kofu-gemma4-edge:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use shebxyd/kofu-gemma4-edge with Docker Model Runner:
docker model run hf.co/shebxyd/kofu-gemma4-edge:Q4_K_M
- Lemonade
How to use shebxyd/kofu-gemma4-edge with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shebxyd/kofu-gemma4-edge:Q4_K_M
Run and chat with the model
lemonade run user.kofu-gemma4-edge-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use shebxyd/kofu-gemma4-edge with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shebxyd/kofu-gemma4-edge:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default shebxyd/kofu-gemma4-edge:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use shebxyd/kofu-gemma4-edge with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shebxyd/kofu-gemma4-edge:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "shebxyd/kofu-gemma4-edge:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Kofu 4.0 Edge (Gemma 4 E4B Q4_K_M)
Kofu 4.0 Edge is an on-device language model fine-tuned from Google's cutting-edge Gemma 4 E4B-it (google/gemma-4-E4B-it) specifically optimized for real-time mobile execution in the Kofu Mobile Assistant via llama.cpp and Android NDK.
- Base Architecture: Gemma 4 (E4B multimodal architecture with 42 text transformer layers, 2560 hidden size, 262,144 token vocabulary).
- Quantization:
Q4_K_M(4-bit medium k-quant) utilizing high-precision fp16 scales. - Model File:
kofu-gemma4-edge-q4_k_m.gguf - Effective Size: ~3.2 GB
- Primary Languages: Spanish (
es), English (en) - Format: GGUF (v3)
π― Fine-Tuning Specialization
Kofu 4.0 Edge is fine-tuned using parameter-efficient Low-Rank Adaptation (LoRA) on curated, high-quality instruction datasets covering:
- Mathematical Reasoning & Logic: Step-by-step problem solving in Spanish (
Yahir/alpaca-logica-programacion). - Software Engineering & Multi-Language Coding: C++, Kotlin, Python, algorithms, and system programming (
sahil2801/CodeAlpaca-20k). - General Knowledge & Conversational Assistant: Polished Spanish instruction following (
plncmm/spanish-alpaca). - Defensive Cybersecurity & Safe Systems: Secure coding patterns and threat analysis (
murdok1982/gemma4-programacion-seguridad).
π¬ Prompt Template
Kofu 4.0 Edge uses the official Gemma 4 turn formatting structure:
<|turn>user
{user_prompt}<turn|>
<|turn>model
{model_response}<turn|>
Generation prompt format:
<|turn>user
{user_prompt}<turn|>
<|turn>model
π± Mobile Integration (Kofu Mobile & llama.cpp)
llama.cpp CLI Execution
./llama-cli -m kofu-gemma4-edge-q4_k_m.gguf -p "<|turn>user
Explica la diferencia entre punteros y referencias en C++.<turn|>
<|turn>model
" -n 512 --temp 0.7 --top-p 0.9 --repeat-penalty 1.1
Kofu Assistant Android App
In Kofu Mobile Assistant, you can select Kofu 4.0 Edge (Gemma 4) directly from the top bar model selector. The engine dynamically sets the PromptStyle::GEMMA_4 tokenizer format and allocates Vulkan/OpenCL/CPU acceleration.
βοΈ License & Terms of Use
This model is subject to the Google Gemma Terms of Use and incorporates modifications under the Apache License 2.0.
- Base Model License: Gemma Terms of Use
- Modifications: Fine-tuning with LoRA on open instruction datasets, merged weights, and quantized to GGUF
Q4_K_M. - Prohibited Uses: Users must comply with Google's Prohibited Use Policy. Do not use for harmful, illegal, or unethical applications.
- Attribution: Based on Google's
google/gemma-4-E4B-it. Developed for Kofu Mobile by shebxyd.
- Downloads last month
- 252
4-bit