SparkientDocs
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
Compiled modelThe compiled ML classifier
Expression 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.

Installation

Install from PyPI
pip install sparkient-edge

For rule evaluation, text field embeddings, or MCP server support, install optional extras:

Install with all features
pip install sparkient-edge[all]
ExtraAddsWhen needed
rulesRule engineDecision types with hard rules
textText embedding libraryDecision types with free-text input fields
mcpmcpRunning as a local MCP server
allAll of the aboveRecommended for full functionality

Export a Bundle

You need a trained decision type with at least 50 training examples before you can 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 sparkient_edge import 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.stage)              # "classifier"
print(result.class_probabilities)# {"approve": 0.94, "flag": 0.04, "reject": 0.02}
print(result.rules_triggered)    # []

EdgeDecision Fields

FieldTypeDescription
decisionstrThe chosen outcome (e.g., "approve")
confidencefloatConfidence score (0.0 to 1.0)
reason_codeslist[str]Why this decision was made
stagestrWhich stage decided: "rules", "classifier", or "fallback"
class_probabilitiesdict[str, float]Probability for each option
rules_triggeredlist[str]Names of rules that fired

Dependencies

The edge predictor requires only:

ML runtime
Rule engine
numpy
Text embeddings

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.

MCP Server

Run the edge predictor as a local MCP server for Claude Desktop, Cursor, or any MCP-compatible client:

Start local MCP server
python -m sparkient_edge

This starts a stdio-based MCP server exposing three tools: make_decision, load_edge_bundle, and get_bundle_info.

On this page