Inspiration
Across Africa, millions of smallholder farmers and STEM students face a dual challenge: increasing exposure to volatile climate risks and severe limitations in digital connectivity. While advanced artificial intelligence and scientific computing are transforming global education and agriculture, these innovations rarely reach offline communities due to high bandwidth costs, expensive cloud infrastructure, and resource-heavy software models.
We were inspired by a fundamental question: How can we bridge classroom mathematics and real-world agricultural decision-making without relying on the cloud?
Mathematics is often taught as abstract, disconnected formulas. We created Nzilab to ground scientific reasoning in tangible everyday utility. By turning quadratic equations into tools for predicting localized crop yields, calculating soil moisture loss, and evaluating climate risk indices, Nzilab transforms abstract STEM concepts into actionable insights for local communities.
What it does
Nzilab is an offline-first educational and decision-making platform designed to operate seamlessly on low-power hardware in bandwidth-constrained environments.
Interactive STEM Learning: Guides students step-by-step through quadratic theory and algebraic modeling using a high-contrast, WCAG-compliant design system optimized for low-cost displays.
Offline Socratic AI Tutor: Features an on-device AI assistant that helps students solve math problems through guided questioning without giving away direct answers.
Agricultural Risk Simulations: Integrates deterministic math models with local climate datasets to calculate Agricultural Risk Indices (IRAA), helping users model rainfall trends, crop yields, and irrigation scenarios.
How we built it
Nzilab is built from the ground up as an offline-first, high-performance edge architecture running on Ubuntu Server 22.04 LTS:
Core UI: Built using Python 3.10 and Streamlit with a high-contrast design system for low-power displays.
Deterministic Math & Risk Engines: Handles algebraic evaluations and step-by-step resolution of quadratic models of the form ax^2 + bx + c = 0 using the quadratic formula x = (-b ± √(b^2 - 4ac)) / 2a. Computes localized risk indices by combining historical climate datasets with real-time parameter shifts.
Offline Socratic LLM Tutor: Powered by llama-cpp-python running a quantized Qwen 2.5 3B Instruct GGUF model (Q4_K_M) completely on-device.
Performance Caching Layer: Leverages Streamlit resource caching (@st.cache_resource and @st.cache_data) and client-side tab navigation to eliminate full-page re-renders and preserve CPU cycles.
Challenges we ran into
Engineering an AI-powered educational engine to run smoothly on an Ubuntu Server environment without internet access presented severe technical hurdles:
Compilation & Toolchain Errors: Compiling native C/C++ dependencies for llama.cpp and llama-cpp-python on Linux required precise build configurations to avoid C++ standard library linking failures.
Strict RAM & Memory Footprint Limitations: Running a 3-billion-parameter LLM alongside data-processing pipelines risks triggering Linux Out-Of-Memory (OOM) killers. We resolved this by applying 4-bit quantization (Q4_K_M) to keep peak Resident Set Size (RSS) strictly within tight resource bounds.
Zero-Latency UI Optimization: Streamlit's default behavior re-runs scripts top-to-bottom on every user interaction. We optimized state management and replaced full-page re-renders with native client-side tab navigation, ensuring fluid responsiveness without CPU throttling.
Validation with ADTC Profiler: Benchmarking our stack using the official adtc-profiler forced us to eliminate memory leaks, optimize thermal behavior, and stabilize token-generation throughput.
Accomplishments that we're proud of
100% Offline AI Execution: Successfully deployed a Socratic AI tutor running entirely on local hardware with zero cloud dependencies.
Zero-Lag Interface: Rebuilt the frontend architecture to achieve instant, responsive tab navigation on low-power servers.
ADTC Profiler Compliance: Passed rigorous benchmark checks for memory footprint, token throughput, and thermal efficiency.
Multilingual Support: Fully localized the application in both English and Swahili to ensure accessibility across diverse regional communities.
What we learned
Edge AI is the Future of Accessibility: High-quality educational tutoring does not require massive cloud data centers. Small, highly targeted, quantized open-source models like Qwen 2.5 3B can deliver context-aware instruction locally.
Performance is Accessibility: Optimizing low-level memory usage directly translates to longer battery life and better usability on low-cost equipment in rural regions.
Contextual Learning Works: When students see how solving a quadratic parabola y = ax^2 + bx + c directly maps to predicting rainfall retention or agricultural risk, abstract theory becomes immediate, practical knowledge.
What's next for Nzilab
Expanding Subject Domains: Extending the deterministic engines to cover additional STEM subjects, including physics and chemistry modeling for agriculture.
Broader Regional Localization: Adding more African languages (such as Portuguese, Hausa, and Amharic) to broaden regional accessibility.
Low-Power Hardware Bundling: Packaging Nzilab into pre-configured single-board devices (like Raspberry Pi and low-cost laptops) for direct distribution to offline schools and community centers across Africa.
Log in or sign up for Devpost to join the conversation.