Sparkient Docs
Edge SDK

Edge Deployment

Run Sparkient decisions locally with zero cloud dependencies.

The Edge SDK lets you export a trained decision type as a standalone bundle and run it locally — on-device, on-premise, or in air-gapped environments. Zero network calls, zero cloud dependencies.

How It Works

A Sparkient edge bundle contains everything needed to make decisions offline:

ComponentPurpose
ONNX modelThe compiled ML classifier
CEL rulesHard rules, evaluated first
Feature configHow to extract features from input
MetadataDecision type name, options, version

The entire bundle is a single ZIP file, typically 1–5 MB.

Export a Bundle

Download edge bundle
curl -X GET https://api.sparkient.ai/api/v1/decision-types/{id}/export \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o my_decision_type.zip

Use in Python

Edge inference
from edge import load_bundle, EdgePredictor

# Load the exported bundle
predictor = EdgePredictor.from_bundle("my_decision_type.zip")

# Make a decision (< 10ms, no network)
result = predictor.predict({
    "text": "Check out this product",
    "user_score": 0.85,
    "link_count": 1
})

print(result.decision)     # "approve"
print(result.confidence)   # 0.94
print(result.reason_codes) # ["safe_content"]
print(result.latency_ms)   # 3.2

Dependencies

The edge predictor requires only:

onnxruntime
cel-python
numpy

No FastAPI, no database, no Redis, no cloud SDKs. It's designed for constrained environments.

Use Cases

  • On-device inference — Mobile apps, IoT devices, embedded systems
  • Air-gapped environments — Government, military, healthcare systems without internet
  • Ultra-low latency — Eliminate network round-trip for sub-10ms decisions
  • Cost optimization — Zero API calls after the initial bundle download
  • Offline-first applications — Apps that need to work without connectivity

Updating

When you retrain and deploy a new model, export a new bundle and replace the old one. The edge predictor loads the latest bundle on initialization.

On this page