Skip to main content

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

  1. Export an edge bundle from Sparkient (dashboard or GET /api/v1/decision-types/{id}/export)
  2. Load the bundle with EdgePredictor.from_bundle("path/to/bundle.zip")
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparkient_edge-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sparkient_edge-0.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

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

Hashes for sparkient_edge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ff3ff57c77c260c85a9f0240dee346b239298c8231fc03b4dc2d9c14e8cb6f7
MD5 66585fcde05bafd120d4494af5a460f2
BLAKE2b-256 bd0cb29b5bca3a840b9d604ab775d8422c735e27e07bea11c5cc32ad0022dab9

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparkient_edge-0.1.0.tar.gz:

Publisher: publish-edge.yml on peterdobson1001/FastDecision

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for sparkient_edge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ff490fe12d26e4f074e5c98e676f6112c10be60fc0fd9aab468ca4410d68d4b
MD5 914c2ba738bbca456a8fd0c175a21ea8
BLAKE2b-256 5ac97c1592d14a641d57c09aac39740757f0ed735d07faf491d1839b4381efe9

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparkient_edge-0.1.0-py3-none-any.whl:

Publisher: publish-edge.yml on peterdobson1001/FastDecision

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page