Repository navigation
Closed
Labels
Milestone
Description
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
-
EdgeRuntimeLLM wrapper — wraps any local llama.cpp / ONNX model -
LlamaCppLLMprovider with streaming -
ONNXEmbeddingsprovider -
MLXLLM— Apple Silicon optimized (Metal) -
FallbackPolicy— declarative routing -
PIIRedactor— auto-redact before any cloud fallback - Model registry:
synapsekit edge pull llama-3.2-3bCLI - 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 (
CostQualityRouterlearns 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,GPT4AllLLMare stepping stones - Pairs with
CostQualityRouterfor smart local↔cloud routing
Activity
Merge pull request #865 from SynapseKit/integrate/v2-batch-jul2026
test(edge): add 200-task local-vs-cloud benchmark for SynapseKit#736
Merge PR SynapseKit#863: edge extra CVE fix + local-vs-cloud benchmark (
docs(changelog): record marketplace, UMP, twin, time-travel, edge CVE (…