Skip to content

v2.0: Edge SynapseKit — on-device inference with cloud fallback #736

Closed

Description

@AmitoVrito

Summary

Compile a subset of SynapseKit to run on-device via llama.cpp + ONNX Runtime, with seamless cloud fallback for tasks exceeding local capacity. Privacy-first agents that run on laptops, phones, and edge servers.

Motivation

Enterprise + regulated industries (healthcare, finance, defense) cannot send sensitive data to cloud LLMs. Today they're forced into bespoke local setups. A first-class "edge mode" makes SynapseKit the obvious choice for privacy-critical deployments and unlocks consumer apps (offline-first assistants).

Design Sketch

from synapsekit import EdgeRuntime, FallbackPolicy

runtime = EdgeRuntime(
    local_llm=\"llama.cpp:Llama-3.2-3B-Q4_K_M.gguf\",
    local_embeddings=\"onnx:all-MiniLM-L6-v2.onnx\",
    cloud_llm=AnthropicLLM(),  # fallback
    fallback=FallbackPolicy(
        if_context_exceeds=8192,
        if_tool_unsupported_locally=True,
        if_user_opts_in=True,
        require_pii_redaction_before_fallback=True,
    ),
)

agent = Agent(llm=runtime, ...)
# Runs locally by default. Falls back to cloud only when policy allows.

Components

  • EdgeRuntime LLM wrapper — wraps any local llama.cpp / ONNX model
  • LlamaCppLLM provider with streaming
  • ONNXEmbeddings provider
  • MLXLLM — Apple Silicon optimized (Metal)
  • FallbackPolicy — declarative routing
  • PIIRedactor — auto-redact before any cloud fallback
  • Model registry: synapsekit edge pull llama-3.2-3b CLI
  • Edge-mode vector store: SQLite-vec (already shipped) becomes default
  • Quantization helpers: synapsekit edge quantize <hf-model>
  • Mobile bindings exploration: Swift + Kotlin wrappers (post-v2.0 if scope creeps)

Use Cases

  • Healthcare: PHI never leaves the device
  • Legal: privileged communications stay local
  • Field operations: works offline (planes, ships, remote sites)
  • Consumer: $0 marginal cost personal assistants
  • Latency-critical: tool calls under 100ms

Risks

  • Quality gap — small local models are weaker. Mitigate with task routing (CostQualityRouter learns when local is good enough).
  • Binary size — llama.cpp + ONNX add MB. Make it an opt-in extra: pip install synapsekit[edge].
  • Platform matrix — must work on Linux/Mac/Windows/ARM. CI matrix expansion needed.

Acceptance Criteria

  • Hello-world agent runs fully offline on a 16GB MacBook
  • Fallback to Claude triggers correctly when context > local limit
  • PII redaction blocks SSNs/emails/phone numbers before cloud
  • Benchmarks: local Llama 3.2 3B vs Claude on a 200-task suite, document tradeoffs
  • Docs: "Building a HIPAA-safe agent" tutorial

Related

  • Existing LMStudioLLM, VLLMLlm, GPT4AllLLM are stepping stones
  • Pairs with CostQualityRouter for smart local↔cloud routing

Activity

  1. added
    enhancement
    performance
    v2.0
    on Jun 25, 2026
  2. added this to the v2.0.0 milestone on Jun 25, 2026
  3. added
    v2.0.1
    and removed
    v2.0
    on Jul 18, 2026
  4. modified the milestones: v2.0.0, v2.0.1 on Jul 18, 2026
  5. self-assigned this
    on Jul 18, 2026
  6. added a commit that references this issue on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementperformancev2.0.1

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions