Overview
This feature eliminates the dependency on centralized AI API servers entirely by turning every instance of opencode-android into a node in a distributed edge-compute mesh. When your device needs AI inference but lacks local compute power, it silently routes the task to nearby trusted devices in the mesh β splitting the workload across multiple phones, tablets, or Android TV boxes.
Why This Is Revolutionary
Currently, mobile AI coding assistants face a hard tradeoff:
- Cloud inference: Fast but requires internet, exposes your code to servers, costs money
- On-device inference: Private and free but crushingly slow on most Android hardware
The mesh breaks this tradeoff entirely. Your code stays encrypted and private, but you get near-cloud inference speeds using idle CPU/GPU cycles from devices around you.
Architecture: Sovereign Inference Network (SIN)
Node Discovery
Nodes discover each other through three channels (in priority order):
- Local WiFi broadcast β fastest, zero latency, used for home/office networks
- Bluetooth LE beacons β proximity-based, no WiFi needed
- Encrypted DHT overlay β internet-based fallback using a distributed hash table (like BitTorrent)
Task Splitting
Large inference tasks (e.g., analyzing a 2,000-line file) are split using tensor parallelism:
data class InferenceShard(
val shardId: UUID,
val layerRange: IntRange, // e.g., layers 0-12 of a 32-layer model
val inputTokens: EncryptedBlob,
val encryptionKey: ByteArray,
val deadline: Long // milliseconds until shard expires
)
fun distributeInferenceTask(task: InferenceTask, mesh: MeshTopology): List<InferenceShard> {
return TensorShardingEngine.split(
task = task,
nodes = mesh.availableNodes.sortedBy { it.computeScore },
strategy = ShardingStrategy.PIPELINE_PARALLEL
)
}
Privacy Guarantees
- Each shard is individually meaningless β a node running shard 3 of 8 sees only a fragment of encrypted activations with no access to the original tokens
- Shards are encrypted with ephemeral keys that expire after the task completes
- No node ever accumulates enough information to reconstruct your code
Contribution & Reputation
- Devices that contribute compute earn Compute Credits stored locally
- Credits are spent when your device needs to offload tasks
- A reputation system penalizes nodes that return corrupted or slow results
- Optional: contribute anonymously with zero-account setup
Android Implementation Highlights
- Uses Android's WorkManager for background shard processing that respects battery and thermal constraints
- Integrates with Android Nearby API for peer discovery without Bluetooth pairing
- Thermal throttling detection pauses contribution when device temperature exceeds 42Β°C
- Sharding engine written in Kotlin/Native with NNAPI acceleration for the inference computation
Acceptance Criteria
"Your phone is more powerful than a 2010 supercomputer. Why is it sitting idle while your AI waits for a server response?"
Overview
This feature eliminates the dependency on centralized AI API servers entirely by turning every instance of opencode-android into a node in a distributed edge-compute mesh. When your device needs AI inference but lacks local compute power, it silently routes the task to nearby trusted devices in the mesh β splitting the workload across multiple phones, tablets, or Android TV boxes.
Why This Is Revolutionary
Currently, mobile AI coding assistants face a hard tradeoff:
The mesh breaks this tradeoff entirely. Your code stays encrypted and private, but you get near-cloud inference speeds using idle CPU/GPU cycles from devices around you.
Architecture: Sovereign Inference Network (SIN)
Node Discovery
Nodes discover each other through three channels (in priority order):
Task Splitting
Large inference tasks (e.g., analyzing a 2,000-line file) are split using tensor parallelism:
Privacy Guarantees
Contribution & Reputation
Android Implementation Highlights
Acceptance Criteria