How anbukumaran1/kernalgemma works
KernelGemma combines a synthetic eBPF training-data generator with an interactive eBPF control CLI. The main documented workflow creates natural-language intents and verifier-safe XDP/kprobe C, validates and persists accepted rows plus provenance, and can resume interrupted generation. Separately, the CLI turns operator intents into programs, verifies and attaches them, and presents live telemetry; Ollama is its fallback. The README also documents a Colab QLoRA fine-tuning workflow. Some internal call paths are not visible in the excerpts, so those links are omitted or marked unverified.
Main entry points: dataset_engine.py Generation Engine · cli.py Interactive CLI · kernelgemma_dataset.jsonl JSONL Dataset · kernelgemma_dataset.jsonl.meta.jsonl Provenance Manifest
Components 17
Dataset Generation
- Generation Engine
dataset_engine.py - Job Specs and Templates
dataset_engine.py - Intent and C Generator
dataset_engine.py
Verification and State
- eBPF Validator
dataset_engine.py - Optional Clang Check
dataset_engine.py - JSONL Dataset
kernelgemma_dataset.jsonl - Provenance Manifest
kernelgemma_dataset.jsonl.meta.jsonl
eBPF Control CLI
- Interactive CLI
cli.py - Intent Routing
cli.py - Code Preparation
cli.py - Packet Telemetry HUD
cli.py
Model Fine-Tuning
- Fine-Tuning Workflow
KernelGemma_Unsloth_Trainer.ipynb
Other components
- Operator
- Gemini API
- Ollama
- BCC Runtime
- Linux eBPF Hooks
Connections 17
- Operator → Generation Engine: configures generation
README.md - Generation Engine → Job Specs and Templates: creates job specs
dataset_engine.py - Job Specs and Templates → Intent and C Generator: supplies templates
dataset_engine.py - Generation Engine → Intent and C Generator: generates samples
dataset_engine.py - Generation Engine → Gemini API: requests generation
README.md - Generation Engine → eBPF Validator: validates samples
README.md - Generation Engine → Optional Clang Check: optionally compiles
README.md - Generation Engine → JSONL Dataset: writes accepted rows
README.md - Generation Engine → Provenance Manifest: records provenance
README.md - Operator → Interactive CLI: enters security intent
cli.py - Interactive CLI → Intent Routing: routes intent
cli.py - Intent Routing → Ollama: requests fallback
cli.py - Interactive CLI → Code Preparation: prepares program
cli.py - Code Preparation → BCC Runtime: compiles and verifies
cli.py - BCC Runtime → Linux eBPF Hooks: loads hooks
- Linux eBPF Hooks → Packet Telemetry HUD: emits trace events
- JSONL Dataset → Fine-Tuning Workflow: loads training data
README.md