TerraForge
TerraForge powers data-driven climate action
Created on 22nd March 2026
β’
TerraForge
TerraForge powers data-driven climate action
The problem TerraForge solves
π TerraForge: Environmental Intelligence OS
Bridging rural agricultural diagnostics with government-level climate policy using Hybrid Edge-AI
π Overview
TerraForge is an AI-driven Environmental Operating System for real-time environmental tracking and predictive policy simulation, enabling governments and citizens to make proactive, data-driven climate decisions.
Unlike cloud-dependent AI systems (high latency, API costs, bandwidth-heavy), TerraForge uses a Hybrid Edge-AI architecture with locally deployed, quantized 1.1B parameter LLMs, ensuring:
- β‘ Zero API costs
- π Complete data privacy
- βοΈ Low-latency performance
π Core AI Pipeline (Local ML)
A tightly integrated pipeline of optimized models:
π§ TinyLlama-1.1B (Core LLM)
Dual LoRA adapters:
- Agricultural Diagnostic LLM β Crop/Livestock issue detection
- Policy Strategy LLM β 3-tier plans (Strict / Moderate / Advisory)
π Key Innovation: Real-Time Prompt Injection
Live API + ML outputs are injected into prompts before generation:
- β No hallucinations
- β Context-aware outputs
- β Scientifically grounded explanations
π NLLB-200 (Translation Layer)
- Converts regional languages β English β back to native
- Enables multilingual rural accessibility
ποΈ Whisper (Speech Input)
- Voice-to-text for non-technical users
π gTTS (Speech Output)
- Converts responses into audio (
.mp3)
π Random Forest (Prediction Engine)
- Processes AQI, rainfall, feed, temperature, etc.
- Predicts yield changes (e.g., milk/crop output)
- Feeds results into LLM for explanation
π₯οΈ Frontend Ecosystem
Built with Next.js + React + TailwindCSS + Shadcn UI
π¨βπΎ Farmer Dashboard
- π¦οΈ Live weather & AQI (Open-Meteo API)
- π Yield prediction from real-time stress factors
- π€ Multilingual voice assistant (speech + audio output)
- π‘ Works in low/no internet environments
ποΈ Government Dashboard
- πΊοΈ Geospatial map (react-leaflet)
- π₯ NASA FIRMS fire hotspot overlay
- π€ AI-generated policy recommendations
- π§ͺ βWhat-ifβ simulation sandbox
- π Auto PDF reports (jsPDF)
π§ Architecture (API + AI Flow)
Separated into Training (Past) and Inference (Present/Future)
ποΈ Phase 1: Offline Training
- Historical data (2021β2024)
- Granger Causality (statsmodels) β discovers environmental relationships
- Train RandomForest regressors β saved as lightweight models
β‘ Phase 2: Live Inference
- Fetch live APIs (Open-Meteo, OpenAQ, NASA FIRMS)
- Apply trained rules β instant predictions
- Inject results into TinyLlama prompt
- Generate explanation
- Translate (NLLB) + Voice output (gTTS)
π Foundational Datasets
- π₯ Fires & Emissions β NASA FIRMS, Climate TRACE
- π«οΈ Air & Weather β OpenAQ, IMD
- π§ Water β Central Ground Water Board
- πΎ Agriculture β ISRO/USGS (NDVI), Animal Husbandry (Milk Yield)
- π° Economy β Agmarknet, Census of India
π» Tech Stack & Deployment
Frontend:
Next.js 14, React, TailwindCSS, Shadcn UI, React-Leaflet, jsPDF
Backend:
Python, FastAPI
ML Stack:
transformers, statsmodels, scikit-learn, pandas
Models:
TinyLlama, NLLB-200, Whisper
Database:
Supabase (PostgreSQL)
π Deployment Strategy
- π Frontend β Vercel (Global CDN)
- π§ Backend β Local GPU execution
- π Public Access β Ngrok / Cloudflare Tunnels
π‘ Core Value
- Offline-first AI
- Zero API dependency
- Real-time + predictive intelligence
- Multilingual + voice-enabled
- Scalable from farmers β government systems
Built for the future. Running locally. Healing globally. π±π
Challenges we ran into
β‘ Challenges I Ran Into
π§ Running LLMs Locally Without Crashes
One of the biggest challenges was running a 1.1B parameter LLM locally with limited GPU/CPU resources. Initially, the model either crashed or had very slow inference times.
How I solved it:
- Used quantization techniques to reduce memory usage
- Optimized inference with CPU fallback when GPU wasnβt available
- Reduced token generation limits for faster responses
π Eliminating AI Hallucinations
The LLM initially produced generic or incorrect answers due to lack of real-time environmental awareness.
How I solved it:
- Implemented real-time prompt injection
- Injected live API data + ML predictions directly into the prompt
- Ensured outputs were context-aware and fact-based, not guessed
π Multilingual Pipeline Integration
Integrating NLLB (translation) + TinyLlama (LLM) + Whisper (speech) into a single pipeline caused latency and formatting issues.
Problems faced:
- Incorrect translations breaking prompts
- Delays due to multiple model calls
Solution:
- Standardized all inputs into English before LLM processing
- Optimized pipeline flow:
Speech β Translation β LLM β Translation β Audio - Reduced token size to improve speed
π‘ Handling Real-Time APIs Reliably
Live APIs (weather, AQI, NASA FIRMS) sometimes returned inconsistent or missing data, affecting predictions.
How I solved it:
- Added fallback/default values
- Implemented validation and error handling layers
- Cached recent API responses to ensure reliability
πΊοΈ Geospatial Map Performance
Rendering real-time data (fire hotspots, regions) using react-leaflet caused UI lag and overlapping issues.
Solution:
- Implemented marker clustering
- Limited real-time refresh frequency
- Filtered only relevant data points for rendering
π Voice Input/Output Sync Issues
There were delays and mismatches between speech input (Whisper) and audio output (gTTS).
Fix:
- Added async handling and proper sequencing
- Ensured text confirmation before generating audio
- Optimized audio generation timing
π‘ Key Learning
Building TerraForge showed that the hardest part of AI systems isnβt just the modelsβ
itβs orchestrating LLMs, APIs, ML models, and UI into a reliable real-time system.
Tracks Applied (1)
