Part of the Kiwi Edge AI Stack | Founder OS: NZ-Start-Up | Agent policy: .github/agent-fleet/
Sovereign hybrid edge AI for NZ farms and founders - local-first + multi-model, Te Mana Raraunga aligned - collaborating with Venture Taranaki, startups.com investors and Kotahitanga Investment Fund (HITL + cultural advisory for formal approaches).
Agents inform, draft, prepare, monitor, and remind. Humans advise, sign, file, send, and pay.
Anti-hallucination policy: .github/agent-fleet/anti-hallucination.md | Congruence: CAT_CONGRUENCE.md
Coastal Alpine Tech products treat operational and personal data as taonga. Defaults favour local-first operation, purpose-limited collection, and Human-in-the-Loop for high-stakes actions.
| Commitment | Statement |
|---|---|
| No data sales | We do not sell personal information or customer operational data to third parties for advertising, brokerage, or unrelated commercial exploitation. |
| NZ Privacy Act 2020 | Collection, use, storage, and disclosure of personal information is designed to operate in accordance with the Privacy Act 2020 information privacy principles (including IPP awareness and IPP 3A indirect-collection notification where applicable). |
| Te Mana Raraunga | Where Māori data or community data interests arise, systems are designed to operate in accordance with Te Mana Raraunga principles (including Rangatiratanga, Whakapapa, Whanaungatanga, Kotahitanga, Manaakitanga, Kaitiakitanga) as a sovereignty and stewardship lens — not as a marketing slogan. |
| NZ AI safety | AI features follow a NZ AI safety-aligned posture: Algorithm Charter spirit (fairness, transparency, human oversight where relevant), digital.govt.nz / responsible AI guidance awareness, no silent model training on private journals without consent, and HITL for high-stakes outcomes. |
| Security | No silent exfiltration; owner-controlled credentials; least privilege; SecOps / dependency hygiene on the fleet cadence. |
| Governance | Agents inform, draft, prepare; humans advise, sign, file, send, and pay. |
| Pillar | Commitment |
|---|---|
| Privacy | Local-first / offline-capable where practical; Privacy Act 2020; Te Mana Raraunga spirit; third-party AI only when opt-in and labelled |
| Security | No silent exfil of tenant or personal data; owner-controlled keys |
| Governance | HITL for high-stakes; Te Mana Raraunga spirit; multi-region compliance maps in COMPLIANCE_REGIONS.md |
Agents inform, draft, prepare, monitor, and remind. Humans advise, sign, file, send, and pay.
Fleet policy: fivepanelhat / Kiwi Edge AI Stack · COMPLIANCE.md · COMPLIANCE_REGIONS.md · SECURITY.md
Byte Size Kai is Coastal Alpine Tech's lead agritech beachhead - sovereign multi-modal crop intelligence for microgreens and Mana Kai-class growers.
- Rural cloud blackouts - Farms cannot wait on a distant API when the cell tower drops; irrigation and crop decisions must continue offline.
- Unstructured sensor noise - Raw MQTT floats, camera frames, and audio do not become decisions until structured into auditable records.
- Fragmented farm context - Moisture, leaf vision, and equipment sound are usually siloed; growers need one multi-modal picture.
- Compliance and food-system pressure - Biosecurity, food safety, and environmental expectations demand local logs, not opaque foreign SaaS.
- Data sovereignty on whenua - Operational farm data should remain under grower / mana whenua custody (Te Mana Raraunga), not default to offshore models.
| Built capability | What it does |
|---|---|
| Byte Size Kai portal (this repo) | Multi-modal edge pipeline: sensors + vision + local LLM on RPi 5 16GB + Hailo-10H |
| Coastal-Alpine-Core SDK | Shared security, telemetry, Ollama, and portal primitives |
| Sovereign-Edge-Firmware | ESP32 field nodes with mTLS MQTT into the local hub |
| Sister portals | SoilGuard (soil/N caps), AquaGuard (water), Sting (biosecurity vision) when the wedge needs them |
| HITL policy | Agents inform / draft / prepare / monitor / remind - humans approve actuation and commercial decisions |
Clone / CI path: https://github.com/fivepanelhat/Byte-Size-Kai
Portfolio map: fivepanelhat / Kiwi Edge AI Stack
Coastal Alpine Tech is a pre-seed company engineering in New Plymouth, Taranaki, with field context in regional primary industries (including Mana Kai-class / Horowhenua agritech). Benefits are framed as pathways, not guaranteed job numbers.
| Pathway | What it creates |
|---|---|
| R&D and product HQ | Engineering, product, and IP ownership in region - counterweight to capital-city-only tech |
| Field install and support | RPi / Hailo edge nodes, ESP32 sensors, and pilot support need local technicians and partners |
| EDA leverage | Tools that help Venture Taranaki-class programmes onboard more founders without linear staff growth |
| Contractor network | Legal, cultural advisory, hardware, and pilot ops spend that stays in NZ |
| Pathway | What it creates |
|---|---|
| Primary sector competitiveness | Better yield, compliance, and biosecurity decisions support NZ's export food economy |
| Onshore data value | Farm, whanau, and SME operational data stays under NZ custody (Privacy Act + Te Mana Raraunga) |
| Founder formation | Faster, cleaner company setup and RDTI-ready logging keeps more early companies investable in NZ |
| Digital capability outside main centres | Edge AI skills (vision, MQTT, local LLM) transferable across regions |
| Quality of work | Human-in-the-loop design preserves skilled human roles in advice, compliance, and care |
See Solution we have built above. Cross-portfolio map: Kiwi Edge AI Stack | employment detail: NZ-Start-Up investor pack.
| Name | Use |
|---|---|
| Byte Size Kai | Product brand (growers, Mana Kai partners, org front page) |
| Byte-Size-Kai | GitHub repository (this repo) |
| Blue-Moon-Portal | Former repo name - GitHub redirects old URLs |
This repository is Byte Size Kai on the Kiwi Edge stack (RPi 5 16GB + Hailo-10H, Core SDK, local Ollama).
Coastal Alpine Tech Limited pre-seed startup, New Plymouth, Taranaki, Aotearoa New Zealand.
Byte Size Kai is Coastal Alpine Tech's agritech product for sovereign, on-farm microgreen and crop intelligence. Clone/CI path: https://github.com/fivepanelhat/Byte-Size-Kai.
- Who: Built by Coastal Alpine Tech Limited, supporting the Horowhenua Mana Kai Project.
- What: A multi-modal, agentic IoT pipeline that ingests sensor telemetry, audio, and visual data to autonomously manage and predict crop yields.
- Where: Deployed on-site in Horowhenua, New Zealand (Engineered at HQ in New Plymouth, Taranaki).
- When: Active development. We are building the sovereign digital infrastructure of tomorrow, today.
- Why: To establish localized data sovereignty. Relying on cloud compute for real-time agricultural decisions introduces latency and creates dependencies. We are bringing the brain directly to the soil.
Agents inform, draft, prepare, monitor, and remind. Physical actuation and commercial decisions stay human-in-the-loop unless an explicit local allow-list is configured on-site.
- Raspberry Pi 5 (16GB RAM) with Raspberry Pi AI Accelerator / AI HAT+ 2 (Hailo-10H NPU)
- ESP32 microcontrollers for sensor integration
- Python 3.10+
- Ollama (local LLM runtime)
- Gemma 4 E4B-it model (via
ollama pull gemma4:e4b)
We provide separate guides for system environment setup and installation for Windows and Linux users:
- Prerequisites & System Setup Guide: Read setup.md
- Installation Guide: Read installation.md
The fastest way to install is running the cross-platform bootstrap script:
python bootstrap.pyLinux / macOS (Bash)
# Clone the repository
git clone https://github.com/fivepanelhat/Byte-Size-Kai.git
cd Byte-Size-Kai
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Copy environment template and configure
cp .env.example .env
# Edit .env with your settings (MQTT broker, Ollama host, etc.)Windows (PowerShell)
# Clone the repository
git clone https://github.com/fivepanelhat/Byte-Size-Kai.git
cd Byte-Size-Kai
# Create virtual environment
python -m venv venv
.\venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txt
# Copy environment template and configure
Copy-Item .env.example .env
# Edit .env with your settings (MQTT broker, Ollama host, etc.)Note: If you receive an execution policy error, run
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedfirst.
Before running the portal, ensure Ollama is running and the Gemma 4 model is downloaded:
# Terminal 1: Start Ollama server
ollama serve
# Terminal 2: Pull the Gemma 4 model
ollama pull gemma4:e4b
# Verify installation
ollama list
# Expected output: gemma4:e4b c6eb396dbd59 9.6 GB <timestamp>Before running the portal in production, run the validation script to verify all components:
python validate.pyThis will test:
- [OK] Configuration loading from
.env - [OK] Ollama connectivity and model availability
- [OK] MQTT broker connectivity
- [OK] Audio/Video capture streams
- [OK] Hardware control simulation
- [OK] Media pruner functionality
- [OK] AI Agent methods and LLM integration
Expected output (6-7/7 tests pass):
[OK] PASS: configuration
[OK] PASS: ollama
[OK] PASS: mqtt (or [X] FAIL if broker not running)
[OK] PASS: av_capture
[OK] PASS: hardware_control
[OK] PASS: media_pruner
[OK] PASS: ai_agent_methods
Note: MQTT test may fail if no broker is running locally this is expected in development. The portal will attempt reconnection at runtime.
# Start the main orchestrator
python main.pyThe portal will:
- Connect to your MQTT broker for sensor telemetry
- Initialize audio/video capture streams
- Perform health checks on all subsystems
- Begin processing sensor data through Gemma 4 via Ollama
- Run background media pruning (auto-cleanup of old AV buffers)
Diagrams: Architecture images and Mermaid maps describe the target product architecture for this pre-seed stack. They are engineering design maps not claims of large-scale commercial fleet deployment.
Byte Size Kai is a closed-loop microgreens / crop edge agent for Byte Size Kai. MQTT sensors, CSI vision, and audio drive local multimodal Gemma 4 on RPi 5 16GB + Hailo-10H with deterministic hardware control.
%%{init: {
"theme": "dark",
"themeVariables": {
"fontSize": "16px",
"fontFamily": "Inter, ui-sans-serif, system-ui, sans-serif",
"primaryColor": "#0ea5e9",
"primaryTextColor": "#f8fafc",
"primaryBorderColor": "#38bdf8",
"lineColor": "#67e8f9",
"secondaryColor": "#1e293b",
"tertiaryColor": "#0f172a",
"clusterBkg": "#0b1220cc",
"clusterBorder": "#38bdf880",
"titleColor": "#e2e8f0"
},
"flowchart": {
"nodeSpacing": 40,
"rankSpacing": 48,
"padding": 20,
"htmlLabels": true,
"curve": "basis"
}
}}%%
flowchart TB
classDef sense fill:#052e16,stroke:#4ade80,stroke-width:2px,color:#f0fdf4
classDef edge fill:#0c4a6e,stroke:#38bdf8,stroke-width:2px,color:#f0f9ff
classDef core fill:#134e4a,stroke:#2dd4bf,stroke-width:2px,color:#f0fdfa
classDef act fill:#422006,stroke:#fbbf24,stroke-width:2px,color:#fffbeb
classDef store fill:#1e1b4b,stroke:#a5b4fc,stroke-width:2px,color:#eef2ff
classDef ai fill:#3b0764,stroke:#e879f9,stroke-width:2px,color:#fdf4ff
classDef app fill:#1e1b4b,stroke:#c4b5fd,stroke-width:2px,color:#eef2ff
subgraph IN["1. Grow-room inputs"]
MQTT["MQTT sensors<br/>moisture | light | RH"]
CAM["CSI camera<br/>leaf health"]
MIC["Microphone<br/>anomaly audio"]
end
subgraph EDGE["2. Edge hardware RPi 5 16GB + Hailo-10H"]
CORE["Coastal-Alpine-Core"]
LLM["Gemma 4 e4b via Ollama"]
AG["AI agent + schemas"]
PRUNE["Media pruner<br/>SD-safe buffers"]
end
subgraph OUT["3. Actuation"]
PUMP["Pump control"]
LIGHT["Light control"]
ALERT["Alerts"]
end
MQTT & CAM & MIC --> CORE --> LLM --> AG
AG --> PUMP & LIGHT & ALERT
CAM --> PRUNE
class MQTT,CAM,MIC sense
class CORE,AG,PRUNE core
class LLM ai
class PUMP,LIGHT,ALERT act
| Layer | Components | Role |
|---|---|---|
| Inputs | Sensors + vision + audio | Multi-modal crop state |
| Reasoning | Gemma 4 multimodal | Local, offline |
| Control | Pumps | lights |
| Storage | Media pruner | Prevents SD saturation |
Full detail: ARCHITECTURE.md | HARDWARE_SETUP.md
Blue_Moon_Portal/
|
|-- portal_core/ # The Engine Room
| |-- __init__.py
| |-- ai_agent.py # Multi-modal LLM controller (Gemma 4 via Ollama)
| |-- mqtt_client.py # Paho MQTT subscriber for ESP32 telemetry
| |-- av_capture.py # OpenCV/PyAudio streams (CSI camera + mic)
| `-- media_pruner.py # Storage lifecycle management (auto-delete/compress)
|
|-- portal_schemas/ # The Rulebook (Pydantic enforcement)
| |-- __init__.py
| `-- ai_models.py # Pydantic classes (SensorReading, AnalysisResult, CropOptimizationPlan)
|
|-- telemetry_data/ # Local Knowledge Base
| |-- sensor_logs/ # Historical MQTT JSON payloads
| `-- media/ # Image and audio buffer storage
|
|-- requirements.txt # Python dependencies
|-- requirements-dev.txt # Development tools (pytest, black, mypy)
|-- main.py # Asynchronous event loop orchestrator
|-- setup.py # Package configuration
|-- .env.example # Environment variable template
|-- .gitignore # Git exclusions (media, .env, __pycache__)
|-- blue-moon.service # Systemd service for auto-start on boot
|
|-- README.md # This file
|-- ARCHITECTURE.md # Detailed technical breakdown
|-- HARDWARE_SETUP.md # RPi5 + Hailo-10H NPU assembly & driver installation
`-- DEVELOPMENT.md # Local dev setup, mocking, testing
- ARCHITECTURE.md Data flow, module responsibilities, Gemma 4 config, Pydantic schema definitions
- HARDWARE_SETUP.md RPi 5 + Hailo-10H NPU assembly, ESP32 wiring, Ollama installation, critical NPU driver setup
- DEVELOPMENT.md Local dev environment, mock MQTT payloads, testing strategies
- Compute: Raspberry Pi 5 (16GB RAM)
- Acceleration: Raspberry Pi AI Accelerator / AI HAT+ 2 (Hailo-10H NPU, 40 TOPS)
- Sensors: ESP32 microcontrollers streaming via MQTT
- Cameras: CSI camera module (leaf health)
- Audio: USB microphone (anomaly detection)
- Language: Python 3.10+
- LLM Runtime: Ollama (local, no cloud)
- Model: Gemma 4 E4B (4B effective parameters, multi-modal)
- Message Queue: Paho MQTT
- Schema Enforcement: Pydantic (prevents LLM hallucinations)
- Media Capture: OpenCV + PyAudio
- Process Management: Systemd (auto-start on boot)
[OK] Edge-Native: All inference runs locally on RPi 5. No cloud dependency. [OK] Multi-Modal AI: Simultaneously processes sensor telemetry, visual, and audio data. [OK] Deterministic Output: Pydantic schemas prevent conversational hallucinations; LLM must output valid JSON or fail loudly. [OK] Auto-Recovery: Systemd service ensures portal restarts after power loss. [OK] Storage-Aware: Automated media pruning prevents 24/7 AV capture from filling the SD card.
- Source transparency: Public engineering repo under the Coastal Alpine Tech proprietary licence (see
LICENSE) - not an open-source grant. - Honesty: Pre-seed target architecture; see REALITY.md.
Illustrative / re-measure on your hardware. Not audited production SLAs. Informal ballparks on RPi 5 16GB + Hailo-10H + local Ollama; re-run before quoting externally.
- Local inference latency: order of ~1 second per routing/query class workload (model- and load-dependent).
- Energy: NPU-assisted vision workloads are designed for low power edge draw - measure joules on your node via Core telemetry.
- Storage: media pruner is intended to keep AV buffers bounded on SD cards; retention policy is site-configured.
This repository is proprietary (Coastal Alpine Tech Limited). External contributions require a written agreement. Agritech and edge AI partners interested in pilots should open a GitHub Discussion/Issue for commercial contact - do not assume an open-source CLA.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Follow the development guide in DEVELOPMENT.md
- Submit a pull request
- Type hints required (validated with
mypy) - Docstrings for all public functions and classes
- Black formatting (
black .) - Unit tests with
pytest
This project is Licensed under the Coastal Alpine Tech Limited License. See LICENSE for details.
Built by: Wayne Roberts, Coastal Alpine Tech Limited Supporting: Horowhenua Mana Kai Project Location: New Plymouth, Taranaki / Horowhenua, New Zealand Date: Active development (as of May 31, 2026)
Reference: Running Gemma 4 E4B Locally Hardware constraints and edge configuration walkthrough.
Questions? Open an issue or reach out to the Coastal Alpine Tech Limited team.

