Sitemap

From “NEPA Took Light” to Energy-Aware AI: How I Built Sundew v0.5.0

A journey from Lagos power cuts to a bio-inspired algorithm that saves ~83% inference energy by deciding when to think.

5 min readSep 16, 2025

--

Press enter or click to view image in full size
Sundew plant (Drosera) macro with sparkling dew on red tentacles — metaphor for selective activation and energy-aware AI.

Lagos, Houston, and the problem that wouldn’t let me sleep

I grew up in Nigeria, where a familiar sentence could interrupt any moment: “NEPA don carry light.” The power grid blinked, fans slowed to a stop, and we learned to ration everything that used energy — diesel for the generator, charge in a phone, patience in a queue. Years later, I live in the U.S., but that habit — the instinct to budget power — never left.

One August night in Houston, the AC fought the heat and lost. Sleepless, I watched a nature film about carnivorous plants. A sundew sat almost motionless, jeweled with sticky droplets. For a long time: nothing. Then a fly landed — and the plant moved. Not all at once. First a test, then a commitment, then a full digestive response. Minimal energy, until it truly mattered.

I paused the film and wrote in a notebook:

What if AI systems did the same — stay dormant most of the time, and wake up only when the signal is worth it?

That note became Sundew, a bio-inspired controller that solves a problem I’d felt since Lagos: power is precious. And today, I’m releasing Sundew Algorithm v0.5.0 — production-ready, stabilized with hysteresis, and saving ~83% energy in my demos.

The insight: intelligence isn’t constant effort

Growing up with blackouts made me suspicious of “always-on” anything. A lot of AI pipelines still push every frame, packet, or heartbeat through expensive inference. It’s wasteful — on battery, on cloud bills, on the planet. The sundew showed me a different mindset:

  1. Sense cheaply (dew drops feel contact).
  2. Decide with restraint (is this prey… or rain?).
  3. Spend heavily only when justified (digest when it’s worth it).

Sundew encodes that pattern for AI:

  • A significance score from cheap features (magnitude, anomaly, context, urgency).
  • A temperature-controlled gate that converts significance → activation probability.
  • A PI controller + EMA that tracks a target activation rate under an energy budget.
  • A hysteresis gap so the threshold doesn’t thrash near the boundary.

In v0.5.0, the system is calm, predictable, and practical.

What’s new in v0.5.0

  • ~83% energy savings across end-to-end demos
  • Hysteresis gating → stable thresholds, no oscillations
  • Clean CLI (list-presets, print-config, demo)
  • Safer medical preset (conservative activation)
  • HF Space with sliders for vitals — try it in the browser

A humanitarian demo close to home

Nigeria — and many countries like it — needs health tech that lasts. In my maternal health demo, Sundew watches vital signs (systolic/diastolic BP, HR, SpO₂, fetal HR). It stays dormant for normal readings and activates when patterns suggest risk (e.g., developing preeclampsia). In one test run:

  • 1 CRITICAL alert (e.g., 165/105 mmHg)
  • 2 HIGH alerts (developing cases)
  • Energy savings: often 35–80% depending on safety settings
  • Latency: ~0.003s per event

⚠️ Medical disclaimer: Research software, not a medical device. Don’t use it for diagnosis or treatment. Validate with your own data and clinicians.

Open the browser demo: https://huggingface.co/spaces/mgbam/sundew_demo

Try it in 60 seconds

CLI

pip install sundew-algorithms==0.5.0

# See tuned presets
sundew list-presets
# Inspect a preset
sundew print-config auto_tuned
# Run a demo stream (tweak events/temperature)
sundew demo --events 100 --temperature 0.08 --preset auto_tuned

Minimal Python

from sundew import SundewAlgorithm, SundewConfig

cfg = SundewConfig(
activation_threshold=0.78,
target_activation_rate=0.15,
gate_temperature=0.08,
ema_alpha=0.15,
hysteresis_gap=0.02,
energy_pressure=0.04,
min_threshold=0.20,
max_threshold=0.92,
)
sd = SundewAlgorithm(cfg)
event = dict(magnitude=0.75, anomaly=0.80, context=0.60, urgency=0.90)
if sd.process(event):
# run your heavy model here
print("✅ ACTIVE: worth processing")
else:
print("⏭️ DORMANT: saved energy")

Why it works (without the hand-waving)

  • Cheap signals, first. Lightweight scoring avoids spending energy to discover we shouldn’t have spent energy.
  • Soft gate, not a cliff. Temperature keeps a little exploration; avoids brittle cutoffs.
  • PI + EMA. The controller steers toward a target activation rate smoothly; EMA stabilizes rate estimates.
  • Hysteresis. A deadband prevents ping-pong at the threshold — this killed oscillations in earlier builds.
  • Energy pressure. If the battery or budget is tight, the system gently pushes toward thrift.

Typical numbers (my runs):

  • Energy savings: ~70–87% (v0.5.0 demo ~83%)
  • Latency: ~0.003s / event
  • Activation rate: ~8–15%, preset-dependent

Your mileage will vary with your features, thresholds, and stream mix.

From Lagos lessons to a design principle

Back home, we learned to schedule: charge phones when the generator runs; iron clothes when power returns; cook early before dark. We didn’t stop living — we learned when to spend.

Sundew is that principle in code: optimize when to think. Do the tiny thing first — listen, score, and only then decide if the big thing is worth it. It’s not asceticism; it’s strategy.

A Yoruba auntie once told me, “Sùúrù ni baba ìwà.” Patience is the father of character. In compute, patience looks like deferred effort — and it pays back in battery life, heat, and cost.

Where to use it

  • Edge & IoT: camera traps, meters, wearables, gateways
  • Streaming ops: log anomaly detection, fraud pre-gates
  • Safety-critical: conservative presets with human-in-the-loop
  • Any pipeline burning money to confirm most inputs are boring

Where not to use it: if every input is truly high-value, you don’t need a gate — you need a faster model.

What changed between my first write-up and today

When I first wrote about discovering Sundew, I focused on the idea. Since then I’ve:

  • Stabilized the controller with hysteresis (no more threshold dancing).
  • Baked a clean CLI and presets you can print/inspect.
  • Built an HF Space so anyone can test the gating intuition visually.
  • Tuned a conservative medical preset that prioritizes safety over savings.
  • Packaged v0.5.0 with tests, docs, and release notes you can audit.

It’s still simple on purpose. You should be able to read the code and trust the behavior.

Roadmap (collabs welcome)

  • Multi-objective control (accuracy + latency + battery)
  • Hardware-aware energy models, thermal feedback
  • Community benchmarks (vision, audio, time-series)
  • Paper targeting ICML 2025

If this scratches an itch you have in production, I’d love to compare notes.

Links & How to reach me

License: MIT.
Medical disclaimer: Research software, not a medical device.

A final thought

When the sundew sits still, it isn’t idle — it’s ready. That’s what I want for our AI systems: the wisdom to wait, and the courage to act when it counts. From Lagos power cuts to Houston heat, that lesson followed me. With v0.5.0, it finally feels like something anyone can pick up and run.

If this resonates, star the repo, try the demo, and tell me what breaks. The future of AI on the edge won’t come from bigger models alone. Sometimes the smartest move is simple:

Think only when it matters.

--

--

Oluwafemidiakhoa
Oluwafemidiakhoa

Written by Oluwafemidiakhoa

I’m a writer passionate about AI’s impact on humanity

Responses (4)