Platform · SDK

Ship code in six languages, on a runtime that owns the box.

The MOS4 SDK is a language-agnostic embedded application development kit. It provides a container runtime, an in-process MQTT (Message Queuing Telemetry Transport) bridge, 89 typed protobuf interfaces, and console tooling for Python, Rust, Lua, Go, C, and C++ developers. The platform owns network, vehicle, power, and storage; the team writes application logic.

MOS4 SDK architecture: author, run, test, ship, and operate your container across a device fleet and cloud. The platform layer is drawn in cyan; the three things you own — your code, your container, and your cloud endpoint — are drawn in gold.
Author → run → test → ship → operate. The platform owns the runtime, transports, and commodities (cyan); you own your code, your container, and your cloud endpoint (gold).

Key metrics

The numbers that size the integration.

6 SDK languages Python · Rust · Lua · Go · C · C++
89 typed interfaces services across 16 shared type packages
180 platform features declared service surfaces across the OS
10 s hot-swap Rust micro service, end-of-compile to first service call on device
<5% container overhead CPU/RAM; ~10 MB RSS per container.
Six language symbols (Py, R, Lua, Go, C, ++) feeding by arrows into a single container outline — amber on the container

Language runtimes

Six languages with tested base images.

  • Python

    numpy, scipy, PyTorch work as-is. Start from a CI-verified base image.

  • Rust

    First-class. One #[component] annotation wires lifecycle, dispatch, and observability.

  • C

    Wrap legacy libraries. Native bindings via the same OCI container surface.

  • C++

    Modern toolchain. Same surface as C. Cross-compile SDK provided.

  • Go

    OCI container example with CI-enforced image-size budget.

  • Lua

    Tiny static-musl interpreter (~600 KB on disk). Embedded scripting for ops glue without a heavyweight runtime.

OCI container examples ship with CI-enforced image-size budgets across 15 (language, scenario) pairs. System-layer updates — a CPython 3.12 runtime bump, for instance — propagate across the fleet via a single digest change; no customer rebuilds.

All six SDK client languages share the same wire-protocol coverage — request/response, server-streaming, event-bus subscription — with quickstart snippets extracted from the live test suite. The same protobuf definitions and the same MQTT bridge serve every language.

Install

Add the SDK in one command.

Two reference client libraries cover Rust and Python. Other languages reach MOS4 services via the MQTT bridge — no language-specific SDK required.

Rust client

cargo add mos-sdk-client

Rust crate. Generates typed proxies and direct-mode clients from the 89 proto interfaces.

Python client

pip install mos-sdk-client

Python wheel. Same typed surface, async-first, ships with asyncio coroutines.

Lua, Go, C, and C++ reach the same service surface via the in-process MQTT bridge — see the quickstart documentation for per-language examples.

MQTT bridge

Any client. Any language. No Munic SDK.

MOS4 embeds an MQTT broker in-process. Payloads are accepted as plain JSON or as the typed binary format; JSON is transcoded at ingress. A retained service catalog lets clients discover available services at connect time.

MQTT bridge handshake. A Python container using paho-mqtt publishes a JSON or typed-binary payload to the topic mos/rpc/MspService/LoadGraph. The in-process MQTT broker receives the message and transcodes JSON to the typed call at ingress, then dispatches LoadGraph against the MSP service. The service returns a response; the broker publishes it back on the reply topic for the Python client. Any MQTT client library, any language, reaches any MOS4 service with no Munic SDK required.

sequenceDiagram
  participant Py as Python container<br/>(paho-mqtt)
  participant MQ as MQTT broker<br/>(in-process)
  participant Svc as Signal-processing service
  Py->>MQ: PUBLISH mos/rpc/MspService/LoadGraph<br/>JSON or typed payload
  Note over MQ: transcode JSON to typed call at ingress
  MQ->>Svc: typed call LoadGraph(graph)
  Svc-->>MQ: response
  MQ-->>Py: PUBLISH mos/rpc/MspService/LoadGraph/reply
  Note over Py,MQ: any MQTT client library, any language — no Munic SDK required
In-process MQTT broker translates pub/sub topics to typed service calls. JSON or typed binary payloads.

Python MQTT client → MOS4 service

import json
import paho.mqtt.client as mqtt

client = mqtt.Client()
client.connect("localhost", 1883)

# Publish to any micro services via the MQTT bridge
client.publish(
    "mos/rpc/MspService/LoadGraph",
    payload=json.dumps(graph_json),
)

Container → vehicle signals

Any container language reaches any micro service via the MQTT bridge. A Python container subscribing to topic mos/data/vehicle.speed receives the decoded, named signal published by the vehicle-protocol stack — no service code, no Rust, no Munic SDK required.

Rust micro service authoring

One annotation. Thirty lines.

Rust developers writing a native micro service annotate a struct with #[component] and add one build.rs call. The framework generates service dispatch, proxy creation, lifecycle wiring, config accessors, observability instrumentation, and a fake for unit tests.

use mos_sdk::component;

#[component]
pub struct MyService {
    config: MyConfig,
}

#[async_trait::async_trait]
impl provided::my::MyServiceServer for MyService {
    async fn do_thing(&self, req: Request) -> Result<Response> {
        // your logic — observability and lifecycle are wired by the framework
        Ok(Response { ok: true })
    }
}

// build.rs — single call generates server trait, proxy, fake, metrics
fn main() {
    build_api::generate_component_code(env!("CARGO_MANIFEST_DIR"), "src");
}

Generated fakes compile without a running MOS4 daemon — unit tests run on any host.

Live media

RTSP / ONVIF and WebRTC streaming.

The camera capture micro service exposes live RTSP (Real Time Streaming Protocol) / ONVIF and WebRTC paths alongside its MIPI-CSI (camera serial interface), GMSL2 (Gigabit Multimedia Serial Link), and USB UVC inputs. SDK applications subscribing over MQTT or the frame transport receive shared GPU frames irrespective of source. See Vision for the full input matrix.

Console

One binary. Shell, REST, web, serial.

Four transports, one process

The console binary exposes every registered MOS4 micro service, config key, and database entry through HTTP REST + Web UI, an interactive shell, and a serial shell — simultaneously, from one binary. Zero per-service transport code.

Zero-friction services

services call <interface> <method> introspects any registered service. Field debug, on the device.

Container runtime

Production container isolation.

The container manager enforces CPU, memory, and I/O limits per container as a contract — not best-effort. Docker Compose v3 file parsing reuses existing compose workflows. The mcm standalone CLI is pre-installed on production images. For observability and fleet-level telemetry, see Operations.

Overhead

<5% CPU/RAM

RSS per container

~10 MB

Isolation

enforced

CLI

mcm (pre-installed)

Cloud-driven flows

Call any micro service from the cloud via the RPC bridge.

The RPC bridge routes JSON calls from external clients to any registered MOS4 service — including containers. method ListServices() exposes the live catalog at runtime. Use cases: remote debug, unblocking rare field situations, and hybrid flows where an AI agent or a cloud service drives the device. See Micro services for cloud-side surfaces and integration patterns.

The internal RPC port is not exposed by default. External access goes through the MQTT bridge or the RPC bridge — no direct port exposure for tooling.

Platform commodities

The infrastructure your app does not write.

  • Networks

    Modem, WiFi, Bluetooth LE, GNSS. Auto-failover; set policy via TOML. Offline buffering and opportunistic upload when the data plan is constrained.

  • Vehicle

    CAN, OBD-II (On-Board Diagnostics), and 16 vehicle-protocol families. Decoded signals published over MQTT (Message Queuing Telemetry Transport) — no Munic SDK required.

  • Power

    Wake conditions, battery charge strategy, sleep/wake, low-power scheduling via configurable TOML policy.

  • Storage

    Power-fail-safe with wear levelling. Transactional API. Per-container quota.

  • Configuration

    Centralised device settings. API-driven. OTA-deployable.

  • Telemetry

    MD21 protocol — multiplexed, compressed, bi-directional live messaging.

Browse the full catalog to see all available micro services and their interfaces.

What you bring vs what we bring

Honest split.

You bring

  • · Application code in Python, Rust, C, C++, Go, or Lua.
  • · Domain expertise — vehicle decode rules, AI models, business logic.
  • · Tests for your application surface.
  • · The use case and the data contract.

Munic brings

  • · OS, runtime, supervisor, hot-swap in 10 s.
  • · Platform commodities: network, vehicle, power, storage.
  • · 89 typed interfaces — one dependency.
  • · Observability, fleet OTA, and security pipeline.

FAQ

Frequently asked questions

  • What languages ship with pre-built base images?

    Python, Rust, C, C++, Go, and Lua — six language runtimes with OCI container examples and CI-enforced image-size budgets across 15 (language, scenario) pairs.

  • How does the MQTT bridge work?

    MOS4 embeds an MQTT broker in-process — no external broker required. Payloads are accepted as plain JSON or as the typed binary format; JSON is transcoded at ingress. A retained service catalog lets clients discover available services at connect time. Any MQTT client library, any language — reaches MOS4 services with no Munic SDK required.

  • How fast is hot-swap?

    10 seconds from end-of-compile to first successful service call on a real device. When a new process registers a micro service with an existing component.id, the master stops the old instance, injects serialized state, and starts the replacement. No reflash. Hot-swap is a Rust micro service feature; containers (Python, C, C++, Go) follow a different OTA-update path.

  • What is the container overhead budget?

    The container resource budget is under 5% CPU/RAM overhead and approximately 10 MB RSS per container. The mcm standalone CLI is pre-installed on production images.

  • Is the internal RPC port exposed for direct tooling?

    The internal RPC port is not exposed by default. The RPC bridge routes JSON calls from external clients to any registered MOS4 service; use the MQTT bridge or the RPC bridge for external access.

  • What is the RPC bridge for?

    The RPC bridge calls any MOS4 service — including containers — from the cloud via API. Use cases: remote debug, unblocking rare field situations, and hybrid flows where an AI agent drives the device. No protocol or wiring code beyond the service definition and a cloud-side endpoint.

Code is one path. The no-code engines cover signal processing, policy automation, vehicle stacks, and AI funnels — pick the path that matches the work.

Developer Tools

AI-aware tooling for MOS4 developers.

The MOS4 developer pack extends the SDK with an MCP connector, a configuration linter, log readers, and project-graph queries — so the AI tools your team already uses understand the platform. Available with engineering.

See Developer Tools →

Want a sample workspace?

The quickstart covers the SDK surface, language choice, and the wire-protocol contract.

Building on MOS4?

One reply from engineering, ~24h. No deck, no NDA.

Talk to engineering