Kai โ€” Safe AI Tutor for Kids (Gemma 4 E2B fine-tune)

Kai is a LoRA fine-tune of Google's Gemma 4 E2B (instruction-tuned, 4-bit) built as the on-device model for Safe AI Tutor for Kids, an early-childhood tutoring companion for children ages 3โ€“8. It is designed to run fully offline on low-cost Android tablets (~$100 class, 4 GB RAM), so that no child data ever leaves the device.

This repository contains the merged model exported to GGUF (Q4_K_M, 3,253.99 MiB) for on-device inference with llama.cpp-compatible runtimes.

What it is trained to do

  • Socratic scaffolding, not answers โ€” guided questions and observation prompts that keep the child actively creating instead of passively consuming, with strict age-banded language (sentence caps of 8 / 12 / 20 words for ages 3โ€“4 / 5โ€“6 / 7โ€“8).
  • Safety refusals and pivots โ€” warmly redirect unsafe or age-inappropriate requests (dangerous acts, violent or adult content) into safe alternatives, without lecturing.
  • Inclusion by design โ€” persona variants include a literal mode with zero metaphors/idioms for neurodivergent learners, a soft calming mode, and Spanish and Kazakh code-switching modes.
  • Knowing when it doesn't know โ€” a dedicated turn type trains the model to say it doesn't know when context is empty, instead of hallucinating.

Model details

  • Base model: unsloth/gemma-4-e2b-it-unsloth-bnb-4bit (Gemma 4 E2B, instruction-tuned)
  • Adaptation: QLoRA โ€” rank 16, alpha 16, dropout 0, targeting all linear projections (q, k, v, o, gate, up, down); 31,039,488 of 5,154,217,504 parameters trained (0.60%)
  • Training: SFT, 1 epoch over 564 examples (effective batch size 8, learning rate 2e-4, warmup 5 steps, max sequence length 2048), on an NVIDIA A100-SXM4-40GB
  • Frameworks: Unsloth, TRL, PEFT 0.19.1, Transformers
  • Export: merged to 16-bit, converted and quantised with llama.cpp to GGUF Q4_K_M (5.87 bits per weight)
  • Developers: Aisulu Tustykbayeva (engineering) with Ramilya Tustykbayeva, for the Safe AI Tutor for Kids project, prepared for a Stanford Accelerator for Learning submission

Training data

A purpose-built dataset of 564 instruction examples โ€” no child data, no scraped conversations. Each example carries an age cohort, persona variant, child archetype, turn type, a system prompt encoding the safety and pedagogy rules, a grounding context passage, and the target response.

  • Age cohorts: 3โ€“4 (200), 5โ€“6 (201), 7โ€“8 (163), with per-cohort sentence-length caps
  • Persona variants: standard (303), soft mode (75), literal mode (74), code-switch Spanish (66), code-switch Kazakh (46)
  • Turn types: observation prompts (194), Socratic questions (76), multi-turn (64), safety refusals โ€” soft, standard and hard (96), politeness gate (48), growth-mindset closings (44), "I don't know" (42)
  • 15 child archetypes (e.g. The Why Machine, The Perfectionist, The Worrier)

System context

The model is one component of a compound, harness-first system:

  • On device: offline inference, zero retention by design โ€” audio and transcripts are processed in memory and deleted, in line with the project's COPPA and EU AI Act research.
  • Deployed prototype backend (FastAPI): Microsoft Presidio PII scrubbing before inference, ChromaDB retrieval over a vetted knowledge set, a pre-flight LLM safety judge that checks the full response before it is streamed, and Prometheus observability โ€” safety blocks, PII detections, Socratic-response rate, reading-ease (Flesch) tracking, and RAG misses logged as a content-gap signal.

How to use

The GGUF file runs with any llama.cpp-compatible runtime, for example:

llama-cli -m pip-tutor-q4_k_m.gguf -p "You are a safe, helpful tutor for kids." -i

or by importing the model into Ollama / LM Studio as a local GGUF model. (The file inside this repository predates the product's rename from Pip to Kai; its filename was kept so existing links keep working.)

Evaluation status

No formal evaluation results are published with this model yet. An evaluation protocol is specified in the project documentation (a golden set of verified interactions scored for safety โ€” target 100% on refusal cases โ€” Socratic quality, and factual grounding), and results will be added here when the runs are complete. Do not treat this model as validated for production use with children.

Limitations and risks

  • Research prototype. Not a production product and not a substitute for adult supervision. It must not be deployed for unsupervised use by children.
  • A fine-tune reduces, but does not eliminate, the risk of inappropriate or incorrect outputs; the surrounding safety system described above is part of the design.
  • Trained on a small, English-first dataset (564 examples); behaviour outside the covered categories and age bands is not characterised.
  • The training data's system prompts name the tutor "Pip"; the product has since been renamed Kai, and runtime system prompts use the new name.
  • The base model's terms (Google Gemma) apply to this derivative.

Related work by the same author

  • An earlier iteration of the tutor fine-tuned Gemma 3 1B-IT with the same approach.
  • Project site: https://alzion.github.io
Downloads last month
2
GGUF
Model size
5B params
Architecture
gemma4
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support