πŸ€– botte-nano-nn β€” Micro Neural Networks for Agent Pipelines

Replace trivial LLM calls with tiny (<3 KB) neural networks. Deterministic, 5 Β΅s inference, 0 tokens, 0 API calls.

These models are designed for skill/tool pipelines and deterministic systems that need just a little bit of intelligence β€” not a full LLM call.

Why micro NNs in agent pipelines?

Modern AI agents call LLMs for everything β€” even decisions that are trivially classifiable. A pipeline step like "should I retry this operation?" or "is this task simple enough for a local model?" does not need GPT-5. It needs a lightweight classifier that runs locally, deterministically, at 5 Β΅s.

Auto-recovery & degraded mode

Scenario What the micro-NN decides Without it With it
API call failed Should we retry or fall back? LLM call (~500 tokens) 5 Β΅s, 0 tokens
Resource low Which features to disable? LLM call (~800 tokens) 5 Β΅s, 0 tokens
Queue full Process now or delay? LLM call (~400 tokens) 5 Β΅s, 0 tokens
Error spike Alert or silence? LLM call (~600 tokens) 5 Β΅s, 0 tokens

Tool & skill routing

Scenario What the micro-NN decides Without it With it
New task Run locally or send to cloud? LLM call (~300 tokens) 5 Β΅s, 0 tokens
Code file Audit or skip? LLM call (~400 tokens) 5 Β΅s, 0 tokens
Log line Anomaly or normal? LLM call (~500 tokens) 5 Β΅s, 0 tokens

The pattern: "just enough intelligence"

Input β†’ [micro-NN] β†’ decision
              ↓
        (if uncertain) β†’ [small LLM] β†’ decision
                               ↓
                    (if complex) β†’ [full LLM] β†’ decision

This tiered escalation saves 60-90% of tokens by keeping trivial decisions at the micro-NN level. Only the hard cases reach the LLM.

Models

Model Inputs Outputs Size What it decides
effort_classifier 4 3 3.1 KB Easy/medium/hard task effort β†’ route to local/cloud
binary_router 3 2 1.7 KB Local vs cloud: should this use a full LLM?
anomaly_detector 5 2 2.6 KB Log is normal or anomalous β†’ alert or ignore

Features

  • 0 tokens, 0 API calls β€” pure CPU math, ~5 Β΅s inference
  • Rust inference β€” feedforward, f64, no external ML deps
  • Python training β€” pure numpy, backprop from scratch, ~50 lines
  • Deterministic β€” same input = same output, every time
  • Portable β€” 50 KB Rust binary, no GPU, no cloud

Quick start

Python inference (no build needed)

pip install numpy

# Classify task effort (4 features)
python cli.py predict models/effort_classifier.json \
    --input 0.1 0.2 0.8 0.0
# β†’ Prediction: easy (local) (confidence: 0.9797)

# Route to local or cloud (3 features)
python cli.py predict models/binary_router.json \
    --input 0.7 0.2 0.5 --probabilities
# β†’ 0: local    [β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘] 0.1234
# β†’ 1: cloud    [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] 0.8766

# Auto-detect anomaly (5 features)
python cli.py predict models/anomaly_detector.json \
    --input 0.1 0.3 0.9 0.2 0.5
# β†’ Prediction: normal (confidence: 0.9234)

# Or auto-select the right model by input size:
python cli.py which --input 0.1 0.3 0.9 0.2 0.5
# β†’ 🧠 normal (confidence: 92.34%)

Rust inference (faster, 50 KB binary)

cargo build --release
./target/release/botte_nn_cli predict models/effort_classifier.json \
    0.1 0.2 0.8 0.0
# β†’ [0.9797, 0.0123, 0.0080]

As an MCP tool (for any AI agent)

These models are exposed as MCP tools through Botte Secrète's MCP Gateway. Any MCP-compatible agent (Claude Code, Codex, Cursor) can call them directly:

{
  "mcpServers": {
    "botte-gateway": {
      "command": "python",
      "args": ["-m", "skills.mcp_gateway.server"],
      "cwd": "/path/to/botte-secrete"
    }
  }
}

Then: Call tool: botte_nn (model: "effort_classifier", input: [0.1, 0.2, 0.8, 0.0])

Integration in agent pipelines

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Agent Pipeline                       β”‚
β”‚                                                    β”‚
β”‚  Input β†’ [micro-NN classifies effort]             β”‚
β”‚              β”‚                                     β”‚
β”‚              β”œβ”€ easy ───→ local model (0 tokens)   β”‚
β”‚              β”œβ”€ medium ─→ hybrid (small LLM)       β”‚
β”‚              └─ hard ───→ cloud LLM                β”‚
β”‚                                                    β”‚
β”‚  Error β†’ [micro-NN detects anomaly]               β”‚
β”‚              β”‚                                     β”‚
β”‚              β”œβ”€ normal ──→ log + continue          β”‚
β”‚              └─ anomaly ─→ alert + escalate        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Training your own for pipeline decisions

python training/train.py \
    --layers 4 16 3 \
    --activations relu softmax \
    --epochs 200 \
    --samples 1000 \
    --save my_router.json

Train on your own data: logs, routing decisions, error patterns. The network learns in seconds, then runs at 5 Β΅s indefinitely β€” 0 recurring cost.

Architecture

botte_nn/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib.rs          β€” Public API
β”‚   β”œβ”€β”€ matrix.rs       β€” Dot product, mat-vec mul
β”‚   β”œβ”€β”€ activation.rs   β€” ReLU, Sigmoid, Softmax, Linear
β”‚   β”œβ”€β”€ layer.rs        β€” Layer: weights + bias + activation
β”‚   β”œβ”€β”€ model.rs        β€” Model: load JSON β†’ predict
β”‚   └── inference.rs    β€” predict_json helper
β”œβ”€β”€ training/
β”‚   └── train.py        β€” Training loop (numpy, backprop)
β”œβ”€β”€ cli.py              β€” CLI: predict, list, which
└── Cargo.toml          β€” 2 deps (serde, serde_json)

License

MIT — part of Botte Secrète, a multi-agent token optimization platform.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support