Sub-10ms local decisions from Sparkient edge bundles — zero cloud dependencies
Project description
sparkient-edge
Sub-10ms local decisions from Sparkient edge bundles — zero cloud dependencies.
Train your decision model on Sparkient, export an edge bundle, and run predictions locally with no network, no database, and no API calls.
Quick Start
pip install sparkient-edge
from sparkient_edge import EdgePredictor
# Load a bundle exported from the Sparkient dashboard or API
predictor = EdgePredictor.from_bundle("my_decision_type.zip")
# Make a local decision — sub-10ms, no network
result = predictor.predict({
"amount": 750,
"account_age_days": 45,
"risk_score": 0.55,
})
print(result.decision) # "review"
print(result.confidence) # 0.9985
print(result.stage) # "classifier"
print(result.class_probabilities) # {"approve": 0.0006, "review": 0.9985, "block": 0.0009}
How It Works
- Export an edge bundle from Sparkient (dashboard or
GET /api/v1/decision-types/{id}/export) - Load the bundle with
EdgePredictor.from_bundle("path/to/bundle.zip") - Predict with
predictor.predict(your_input)— runs CEL rules then ONNX classifier locally
The bundle contains everything needed: an ONNX model, feature configuration, CEL rules, and metadata. Typical bundle size is 1–10 KB.
Optional Dependencies
The base install includes only onnxruntime and numpy. Install extras for additional features:
pip install sparkient-edge[all] # Everything
pip install sparkient-edge[rules] # CEL rule evaluation
pip install sparkient-edge[text] # Text field embeddings (model2vec)
pip install sparkient-edge[mcp] # MCP server support
| Extra | Adds | When needed |
|---|---|---|
rules |
cel-expr-python |
Decision types with CEL hard rules |
text |
model2vec |
Decision types with free-text input fields |
mcp |
mcp |
Running as a local MCP server |
all |
All of the above | Recommended for full functionality |
MCP Server
Run as a local Model Context Protocol server for AI assistant integration:
sparkient-edge # Uses the CLI entry point
python -m sparkient_edge # Or run as a module
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"sparkient-edge": {
"command": "sparkient-edge",
"args": []
}
}
}
EdgeDecision Fields
| Field | Type | Description |
|---|---|---|
decision |
str |
The chosen outcome (e.g., "approve") |
confidence |
float |
Confidence score (0.0 to 1.0) |
reason_codes |
list[str] |
Why this decision was made |
stage |
str |
Which stage decided: "rules", "classifier", or "fallback" |
class_probabilities |
dict[str, float] |
Probability for each option |
rules_triggered |
list[str] |
Names of rules that fired |
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sparkient_edge-0.1.0.tar.gz.
File metadata
- Download URL: sparkient_edge-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ff3ff57c77c260c85a9f0240dee346b239298c8231fc03b4dc2d9c14e8cb6f7
|
|
| MD5 |
66585fcde05bafd120d4494af5a460f2
|
|
| BLAKE2b-256 |
bd0cb29b5bca3a840b9d604ab775d8422c735e27e07bea11c5cc32ad0022dab9
|
Provenance
The following attestation bundles were made for sparkient_edge-0.1.0.tar.gz:
Publisher:
publish-edge.yml on peterdobson1001/FastDecision
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sparkient_edge-0.1.0.tar.gz -
Subject digest:
7ff3ff57c77c260c85a9f0240dee346b239298c8231fc03b4dc2d9c14e8cb6f7 - Sigstore transparency entry: 1912458049
- Sigstore integration time:
-
Permalink:
peterdobson1001/FastDecision@42d180e35d1c96f37bc56c99889ebb31774e8981 -
Branch / Tag:
refs/tags/sparkient-edge-v0.1.0 - Owner: https://github.com/peterdobson1001
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-edge.yml@42d180e35d1c96f37bc56c99889ebb31774e8981 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sparkient_edge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sparkient_edge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ff490fe12d26e4f074e5c98e676f6112c10be60fc0fd9aab468ca4410d68d4b
|
|
| MD5 |
914c2ba738bbca456a8fd0c175a21ea8
|
|
| BLAKE2b-256 |
5ac97c1592d14a641d57c09aac39740757f0ed735d07faf491d1839b4381efe9
|
Provenance
The following attestation bundles were made for sparkient_edge-0.1.0-py3-none-any.whl:
Publisher:
publish-edge.yml on peterdobson1001/FastDecision
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sparkient_edge-0.1.0-py3-none-any.whl -
Subject digest:
9ff490fe12d26e4f074e5c98e676f6112c10be60fc0fd9aab468ca4410d68d4b - Sigstore transparency entry: 1912458473
- Sigstore integration time:
-
Permalink:
peterdobson1001/FastDecision@42d180e35d1c96f37bc56c99889ebb31774e8981 -
Branch / Tag:
refs/tags/sparkient-edge-v0.1.0 - Owner: https://github.com/peterdobson1001
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-edge.yml@42d180e35d1c96f37bc56c99889ebb31774e8981 -
Trigger Event:
push
-
Statement type: