Sovereign AI Is Not a Product: Why We Built an OS, Not a Platform

by
Sovereign AI Is Not a Product: Why We Built an OS, Not a Platform

Every "sovereign AI" platform I've seen is a dressed-up SaaS. You bring your data, we run the models, you pay per token. That's not sovereignty — that's a managed service with a privacy sticker.

Sovereignty means you control the entire stack: hardware, model weights, fine-tuning pipeline, inference runtime, and — most critically — the decision logic that governs agent behavior. A platform abstracts that control away. An operating system gives it back.

We built Rinet OS — a purpose-built OS for autonomous AI workloads. It's not a platform. It's a kernel, a set of userspace daemons, and a declarative configuration language that lets you define your AI stack as code. This article explains why we went this route, the architecture we settled on, and the hard tradeoffs we made.

The Platform Trap

Platforms are seductive. They offer one-click deployment, auto-scaling, integrated monitoring. But every platform has a ceiling:

  • Lock-in: You use their model registry, their vector store, their agent runtime. Migrating later costs months.
  • Opacity: The platform's scheduler, routing, and failover logic is a black box. When an agent misbehaves, you can't trace it to a kernel preemption or a memory pressure event.
  • Token economics: You pay per inference, per embedding, per storage operation. At scale, these costs dominate and you have no way to optimize the substrate.

We ran the numbers on a typical customer workload: 10 concurrent agents, each doing ~1000 inference calls per hour, with RAG on a 500k-document store. On a major platform, the monthly bill was ~$48k. On bare metal with our OS, it's ~$9k — and we own the hardware.

What an AI OS Actually Is

An AI OS is not Linux with Python installed. It's a minimal kernel (we forked from Linux 6.8) with:

  • GPU-first scheduling: The kernel's CFS is replaced with a custom scheduler that understands GPU memory, PCIe topology, and model pipeline stages. It co-schedules CPU and GPU tasks to minimize data transfer stalls.
  • Unified memory management: A single allocator for host RAM, GPU HBM, and NVMe swap. Models can be partially paged out under memory pressure without crashing.
  • Declarative workload API: You define agents, models, and data sources in a YAML manifest. The OS handles placement, scaling, and fault recovery.

Here's a snippet from our workload manifest:

workload:
  name: customer-support-swarm
  agents:
    - role: triage
      model: mistral-7b-instruct
      lora: triage-v3.safetensors
      resources:
        gpu: 1
        memory: 16Gi
      triggers:
        - on: message
          action: classify_and_respond
    - role: escalation
      model: llama-3-70b
      lora: escalation-v2.safetensors
      resources:
        gpu: 4
        memory: 64Gi
      triggers:
        - on: triage.escalate
          action: handle_escalation
  vector_store:
    backend: milvus
    collection: knowledge_base
    embedding_model: bge-large-en-v1.5

The OS parses this and allocates GPU resources accordingly. If triage memory spikes, the OS pages out less critical model layers to NVMe. If escalation fails, the OS restarts it on a different GPU within 200ms.

The Kernel: GPU-Aware Scheduling

Standard Linux treats GPU as an I/O device. That's wrong for AI. The GPU is the primary compute unit, and the CPU is mostly a coordinator. Our scheduler, gpu_sched, uses a credit-based algorithm:

  • Each agent gets a budget of GPU compute credits per second.
  • The scheduler tracks GPU utilization per streaming multiprocessor (SM) and memory bandwidth per HBM channel.
  • It preempts low-priority inference tasks when a high-priority agent needs to run, but only at pipeline stage boundaries to avoid recomputation.

Key data structure:

struct gpu_ctx {
    pid_t pid;
    uint64_t credits_used;
    uint64_t credits_limit;
    enum gpu_priority priority;
    struct list_head sm_bindings; // which SMs this context is allowed on
    struct hbm_region *mem_regions;
    struct pipeline_stage *current_stage;
};

We measured a 23% throughput improvement over standard cgroups + CUDA MPS for mixed workloads (batch inference + real-time agent responses).

Fine-Tuning at the OS Level

Most platforms treat fine-tuning as a separate service. You upload data, they run a job, you get a new model endpoint. Our OS integrates LoRA training as a first-class operation:

  • The lora_d daemon watches the vector store for new labeled data.
  • When a threshold is met (e.g., 500 new examples), it triggers a fine-tuning job using the same GPU resources that serve inference, but with reduced priority.
  • The OS hot-swaps the LoRA adapter without restarting the agent.

We use unsloth for fast LoRA training. Here's the internal API:

# Called by lora_d daemon
def fine_tune_agent(agent_id: str, new_data: Dataset):
    config = load_agent_config(agent_id)
    model = load_base_model(config.base_model)
    lora = LoRAAdapter.from_pretrained(config.lora_path)
    trainer = SFTTrainer(
        model=model,
        train_dataset=new_data,
        args=TrainingArguments(
            per_device_train_batch_size=4,
            gradient_accumulation_steps=4,
            max_steps=100,
            learning_rate=2e-4,
            output_dir=f"/var/lora/{agent_id}/adapter",
        ),
        peft_config=lora,
    )
    trainer.train()
    # Signal the inference daemon to reload adapter
    signal_adapter_reload(agent_id, trainer.output_dir)

Because the OS controls memory and scheduling, fine-tuning runs without disrupting inference — we reserve 20% GPU memory headroom for training workloads.

Data Sovereignty: The OS as a Trusted Execution Environment

Platforms promise encryption at rest and in transit. But the platform operator holds the keys. Our OS uses AMD SEV-SNP and Intel TDX to create hardware-enforced isolation:

  • Each agent's memory is encrypted with a per-agent key, managed by the OS kernel.
  • The kernel itself is measured at boot via TPM 2.0, and remote attestation proves no tampering.
  • Data from the vector store is decrypted only inside the agent's enclave.

We also built a transparent data pipeline that logs every data access to an immutable audit trail (stored on a separate NVMe drive, write-once-read-many).

# Check audit trail for agent 'triage'
rinet audit --agent triage --since 24h
# Output:
# 2025-03-21T10:00:01Z | triage | read | db.doc.1234 | enclave:0x7f...
# 2025-03-21T10:00:02Z | triage | write | lora.triage-v3 | enclave:0x7f...

The Hard Tradeoffs

Building an OS instead of using a platform comes with costs:

  1. Driver maintenance: We maintain our own GPU drivers (forked from NVIDIA's open-gpu-kernel-modules). Every CUDA update requires backporting. This is ~2 FTE full-time.
  2. Hardware compatibility: We only support a curated list of GPUs (A100, H100, MI300X). Adding a new GPU requires kernel-level changes.
  3. Ecosystem gaps: No kubectl, no Helm charts. Our CLI is minimal. We trade developer convenience for control.
  4. Boot time: Cold boot takes 45 seconds vs 5 seconds for a container. We mitigate with warm pools, but it's a constraint.

Would we do it again? Yes. For a customer running 50+ agents with strict latency and data residency requirements, the platform tax is unacceptable. Our OS gives them predictable performance and full stack ownership.

Lessons Learned

  • Start with the scheduler. Everything else — memory management, fine-tuning, audit — depends on knowing exactly when and where GPU cycles are spent. We rewrote the scheduler three times.
  • Don't abstract hardware topology. Early attempts to hide NUMA domains and PCIe switches hurt performance. Expose them in the manifest; let users decide.
  • Fine-tuning and inference must share resources. Separate clusters waste GPU idle time. Our co-scheduler achieves 85% GPU utilization on average.
  • Audit trails are non-negotiable. Customers demand proof of data isolation. Build it into the kernel, not as an afterthought.

What's Next

We're open-sourcing the kernel scheduler and memory manager under GPLv3. The userspace daemons (lora_d, audit_d) remain proprietary for now. We're also working on multi-tenant support — currently each OS instance runs one customer's workload. The next major release will add secure partitioning.

Sovereign AI means you don't ask permission to run a model, fine-tune on your data, or inspect every layer of the stack. That's not a product feature. It's an operating system philosophy.


Code snippets above are simplified for illustration. Full source at github.com/your-org/rinet-os.

#autonomous#infrastructure#operating-system#philosophy#sovereignty
Share — X / Twitter · LinkedIn · HN · Email
Damir Radulić
Founder of RiNET. On the Croatian internet since 1996 (Kvarner Net). In Amsterdam now, building autonomous AI infrastructure that runs on Monday morning when nobody's watching — sovereign stacks, agent swarms, LoRA fine-tuning, civic-intelligence platforms.