On-Device LLM Clues in a New OS Beta: From the Model Manifest to Runtime
This article analyzes on-device model traces found in the code of a new OS beta, and uses them to explain how on-device large models actually get engineered into a mobile system. It decodes the model manifest and its "total-active parameter" notation, breaks down dense-versus-MoE model tiers and how they map to memory, agent, and system capabilities, and walks through the four hard constraints of on-device inference: memory and bandwidth, heterogeneous backends, context budget, and latency/power. It then shows how agent and memory apps consume models, how runtime handles model detection, backend adaptation, manifest-based rollout, and edge-cloud routing, and closes with a layered evaluation system and five practical principles for shipping on-device AI reliably.
1. Reading the Clues: From the Model Manifest to Runtime
In the first beta of a phone maker’s next-generation OS, community technical media found traces of the vendor’s in-house large-model family at the code level. The identifiers surfaced in two places:
- A “Personal Intelligence Core Component” that powers AI agent capabilities;
- A new “Memory” app.
The internal model manifest lists models at different parameter scales, along with a next-generation model written in a “total parameters - active parameters” notation. The manifest also retains multiple historical version records for one series.
More telling is that the Memory app can check whether the corresponding model files already exist on the device. In hidden settings, the vendor’s own models are listed side by side with common small on-device models from the broader industry.
Connecting these clues reveals a clear evolution path:
- At the model level, the vendor has formed a model matrix with multiple tiers and coexisting architectures, backed by version management to support iteration and rollback;
- At the system level, models are shifting down from an “optional cloud service” into a foundational capability of the agent core component and the Memory app;
- At the distribution level, the vendor is weighing the tradeoffs between “cloud inference” and “on-device resident” deployment.
It’s worth stressing that there is still a considerable distance between “model identifiers appearing in code” and “a feature officially shipping.” That gap is exactly the point: the core difficulty of on-device LLM engineering is not whether a model can run, but how to keep it running stably on real devices and deliver it at scale.
2. Tiered Design as Seen from the Model Matrix
Two kinds of information in the manifest stand out: the combinations of different parameter scales, and the “total-active parameters” notation.
The common industry reading is:
- Models labeled with a single figure (such as 3B or 7B) are mostly dense models. Every forward pass invokes all parameters, so inference cost is predictable, but precision is bounded by the parameter count.
- The “XXB-AYYB” notation typically refers to a Mixture-of-Experts (MoE) structure: the model has XXB total parameters, but each token activates only YYB of them. This carries a large knowledge capacity at a smaller activation cost, at the price of memory having to hold all parameters.
Mapped onto system capabilities, this division looks like:
- Dense small models fit high-frequency, low-complexity tasks such as text rewriting, classification, intent recognition, and local summarization. These tasks usually have a latency budget within a few hundred milliseconds, and users perceive no noticeable pause.
- MoE models fit more complex instruction understanding and planning that demand greater parametric knowledge. Their compute is controllable, but they are more sensitive to memory capacity and bandwidth.
The capability boundaries of the Memory app and the agent are split at exactly this granularity:
- The Memory app leans toward context organization, information extraction, and personalization;
- The agent leans toward task decomposition, tool selection, and multi-step execution.
Retaining multiple historical version records also signals that the vendor understands clearly: every on-device model upgrade comes with fluctuations in precision and stability, so a rollback path must be preserved.
3. The Four Hard Constraints of On-Device Inference
Cloud inference can be approximated as “effectively unlimited compute, scaled on demand.” On-device inference instead faces a device where memory, storage, compute, power, and thermal headroom are all constrained. This yields four hard constraints.
3.1 Memory and Memory Bandwidth: Shaping the Load and Inference Strategy
Device memory must simultaneously host the OS, foreground apps, and the inference process. Even after low-bit quantization, a model with a large parameter count may still occupy hundreds of MB to several GB of resident memory, and inference additionally reserves space for the KV cache. The longer the context and the more concurrent sessions, the larger the KV cache footprint.
Engineering generally follows three principles:
- Quantization: use low-bit weights such as INT8 and INT4, optionally combined with structured sparsity, to compress the memory footprint into a range the device can tolerate;
- On-demand loading: bind the model to the task, load it only when the task triggers, and release it after an idle period;
- Static-graph optimization in the inference engine: apply operator fusion and layout optimization to the compute graph, and keep hot weights resident in the backend’s memory pool to avoid repeated reads from flash.
Illustrative Python for the load/unload strategy:
from dataclasses import dataclassimport time@dataclass(frozen=True)class ModelSpec:name: str # Model identifier, e.g., on-device small model v-4params_b: float # Total parameters (in billions)active_b: float # Activated parameters per inference (equals params_b for dense models)quant: str # Quantization bit width, e.g., int4 / int8backend: str # Inference backend, e.g., npu / gpu / cpuclass LocalModelManager:"""On-device model lifecycle management: on-demand load + idle unload"""IDLE_TIMEOUT_S = 180 # Idle timeout; must be calibrated per device memory tierdef __init__(self, runtime_factory):self._factory = runtime_factory # Factory that builds the inference engineself._spec = Noneself._engine = Noneself._last_used = 0.0self._memory_budget_mb = 512 # Memory budget, dispatched by the system per device tierdef _load(self, spec: ModelSpec):if spec.memory_mb() > self._memory_budget_mb:# Exceeds the local budget: fall back to a cloud model or a smaller tierreturn Noneself._unload() # Release the old model before switchingself._engine = self._factory(spec.backend).load(spec)self._spec = specdef _unload(self):if self._engine is not None:self._engine.release() # Release weights and KV cacheself._engine, self._spec = None, Nonedef run(self, spec: ModelSpec, prompt: str) -> str | None:if self._spec != spec:self._load(spec)if self._engine is None:return None # Let the edge-cloud router decide cloud fallbackif time.monotonic() - self._last_used > self.IDLE_TIMEOUT_S:self._unload()self._last_used = time.monotonic()return self._engine.generate(prompt)
3.2 Heterogeneous Hardware Backends: The Need for a Unified Abstraction
Mobile devices commonly integrate a CPU, a GPU, and a dedicated neural processing unit (NPU), each with different operator sets, precision types, and memory access patterns. When an operator in the model isn’t supported by the NPU, the inference framework falls back the corresponding subgraph to the CPU. This introduces frequent data copies and synchronization overhead that slow down overall latency.
Practical approaches include:
- Running an offline operator-coverage check before deployment;
- Inserting graph-level split markers around unsupported operators;
- Using “cross-backend dual implementation + runtime selection” for high-frequency operators.
In short, the simpler the model structure, the more efficiently it can be carried by the accelerator.
3.3 Context Budget: Limited Windows and Memory Compression
On-device models have relatively limited context windows. Within a finite token budget, the system must decide what information enters the prompt:
- The most recent several rounds of conversation;
- Long-term memory fragments relevant to the current task;
- Structured text from the app interface;
- Tool definitions and their return results.
Common compression techniques include rolling summaries, entity-level memory extraction, and a two-stage retrieval that filters coarsely first and ranks precisely afterward.
3.4 Latency and Power: Quantifying the Experience Red Lines
The “hidden metrics” of the on-device experience are often more sensitive than precision:
- Time to first token (TTFT) determines whether users feel the response is “instant”;
- Output speed determines whether long-form generation feels “janky”;
- Power draw and temperature rise determine whether the device throttles after sustained use.
Mainstream practices include streaming output, distilling the model, and capping the length of a single generation.
4. Agent and Memory Apps: How Models Enter the System
The agent core component and the Memory app are the two main entry points for on-device models into the system. Their technical difficulty is not about making the model answer better, but about constraining the model’s generation within a reliable, traceable process.
The agent core component typically handles four things:
- Intent understanding: mapping a natural-language instruction to a structured task;
- Task planning: decomposing a complex goal into a set of executable steps;
- Tool invocation: selecting and calling appropriate tools from a system-authorized capability list (such as search, settings changes, and information extraction);
- Execution and feedback: observing tool results to decide whether to continue, retry, or ask the user for clarification.
Two engineering constraints are key:
- Tool calls must follow structured-output constraints, with parameters validated against the system’s interface definitions;
- Operations that change device state must pass a permission confirmation and produce a user-visible execution record.
Illustrative planning code:
import json# Adhere to system interface definitions; expose only necessary capabilities# to avoid prompt injection inducing unauthorized operationsALLOWED_TOOLS = {"search", "set_reminder", "summarize_screen"}def plan(user_input: str, model) -> list[dict]:messages = [{"role": "system", "content":"You are an on-device task planner. Output only a JSON array, ""each element shaped like {\"tool\": \"name\", \"args\": {}}, "f"available tools: {sorted(ALLOWED_TOOLS)}. Return an empty array for unknown intent."},{"role": "user", "content": user_input},]# Structured-output constraint + parameter validation keep downstream calls saferaw = model.generate(messages, schema="tool_call_list", max_steps=4)try:steps = json.loads(raw)except json.JSONDecodeError:return []# Whitelist filtering prevents the model from emitting unauthorized tool namesreturn [s for s in steps if s.get("tool") in ALLOWED_TOOLS]
The Memory app is closer to a “privacy-first personal knowledge base” and can be broken into four layers:
- Collection layer: gathering only authorized structured information, such as app usage preferences, to-do items, and key facts the user has explicitly confirmed;
- Extraction layer: using the on-device model to convert unstructured text into structured memory entries, each tagged with its source and a timestamp;
- Storage layer: local encrypted storage with indexable entry-level metadata;
- Retrieval layer: relevance ranking based on the current task, injecting recalled content into the prompt.
Key design points:
- Memory entries should be viewable, editable, and deletable, with a one-click switch to disable the memory feature, ensuring users have clear control over their data;
- Recalled content should serve only as reference and must not override system instructions or the user’s real-time input, suppressing both “memory pollution” and prompt injection;
- Highly sensitive data should preferably be redacted and summarized on-device first, reducing the amount of raw information sent to the cloud.
5. Runtime: Model Detection, Backend Adaptation, and Edge-Cloud Collaboration
5.1 A Unified Abstraction for Multiple Coexisting Models
Since the manifest lists multiple models alongside several general-purpose models from the industry, the system needs a unified model abstraction: the upper business layer cares only about “capability tags,” not about which model is used or which backend it runs on. An illustrative interface:
// Unified on-device inference interface (illustrative): the upper layer depends// only on capability tags, not on specific models or backendsstruct GenerateOptions {int max_new_tokens = 128; // Upper bound on generated lengthfloat temperature = 0.2; // Sampling temperaturebool stream = true; // Whether to stream the response};class ModelRunner {public:virtual ~ModelRunner() = default;// Capability tag examples: summarize / rewrite / intent / extractvirtual bool Supports(const std::string& capability) const = 0;virtual std::string Run(const std::string& capability,const std::string& prompt,const GenerateOptions& opts) = 0;virtual void Release() = 0;};
5.2 Device Capability and Model Adaptation Probing
Model-file checks and hardware capability probing should run asynchronously after boot, with results written into a unified device capability profile. Illustrative code (no specific library names):
// Capability probing (illustrative): try candidates by priority and take the// first backend that loads successfully#include <dlfcn.h>#include <vector>#include <string>struct BackendProbeResult {std::string backend; // npu / gpu / cpuvoid* handle = nullptr;bool ok = false;};// Library names in candidates are dispatched by configuration; the example only// illustrates ordering and contains no real product namesBackendProbeResult ProbeRuntime(const std::vector<std::string>& candidates,const char* entry_symbol) {BackendProbeResult result;for (const auto& lib : candidates) {// RTLD_NOW requires all symbols to resolve immediately, exposing// missing-dependency issues as early as possiblevoid* h = dlopen(lib.c_str(), RTLD_NOW);if (h == nullptr) continue;// The backend counts as available only if the symbol existsif (dlsym(h, entry_symbol) != nullptr) {result.handle = h;result.backend = lib;result.ok = true;break;}dlclose(h);}return result;}
5.3 The Model Manifest and Staged Rollout
The model manifest is essentially a piece of configuration data carrying capability tags, task types, hardware requirements, memory budgets, rollout percentages, and rollback versions. Because the root causes of configuration issues are often hard to reproduce, the manifest must be versioned, traceable, and rollback-ready:
{"manifest_version": 3,"models": [{"id": "local-small-4b-e2b","family": "in-house on-device model family","family_version": 4,"params_b": 4.0,"active_b": 2.0,"quant": "int4","backends": ["npu", "cpu"],"capabilities": ["summarize", "rewrite", "intent", "extract"],"min_ram_gb": 8,"min_storage_mb": 1200,"rollout_percent": 10,"fallback_to": "cloud"},{"id": "local-dense-3b","family": "in-house on-device model family","family_version": 3.8,"params_b": 3.0,"quant": "int8","backends": ["npu", "gpu", "cpu"],"capabilities": ["summarize", "intent"],"min_ram_gb": 6,"min_storage_mb": 900,"rollout_percent": 100}]}
5.4 Edge-Cloud Routing and Fallback
On-device models are not meant to replace cloud models. On-device models handle latency-sensitive, privacy-sensitive, and offline scenarios, while cloud models handle long-chain tasks that need stronger reasoning. Both are exposed through the same interface, with a routing layer making the decision:
TASK_PROFILE = {"summarize": {"prefer": "local", "max_ttft_ms": 400, "allow_cloud": True},"intent": {"prefer": "local", "max_ttft_ms": 200, "allow_cloud": False},"plan": {"prefer": "cloud", "max_ttft_ms": 1500, "allow_cloud": True},"privacy": {"prefer": "local", "max_ttft_ms": 800, "allow_cloud": False},}def route(task: str, device_profile: dict, cloud_status: dict):"""Edge-cloud routing: check privacy and offline constraints first,then compare latency and capability match"""prof = TASK_PROFILE.get(task, TASK_PROFILE["summarize"])if not prof["allow_cloud"]:return ("local", prof) # Privacy tasks forced on-deviceif cloud_status.get("reachable") is False:return ("local", prof) # Fall back on-device when offlineif cloud_status.get("ttft_ms", 0) <= prof["max_ttft_ms"]:return ("cloud", prof) # Prefer cloud if its latency meets the targetreturn ("local", prof) # Otherwise hand off to on-device
5.5 Observability
Observability for on-device AI is more complex than for the cloud. Each call should be logged with its model version, backend, quantization bit width, TTFT, total latency, input/output length, and device temperature rise.
Two requirements apply to logging:
- Raw text is not persisted by default, or is redacted before being recorded;
- Log collection and querying typically rely on a cloud logging service.
On the quality side, teams should build offline evaluation sets and an online sampling re-evaluation mechanism, forming a “release-monitor-reevaluate-iterate” loop.
6. Engineering Evaluation and Practice
6.1 A Layered Evaluation System
| Layer | Evaluation target | Typical metrics | Notes |
|---|---|---|---|
| Model | Weights and quantization version | Task accuracy, hallucination rate, format-compliance rate | Compare precision tiers and prompt templates |
| Inference | Engine and backend combinations | TTFT, output speed, peak memory, energy efficiency | Cover high-, mid-, and low-end device tiers |
| Agent | Planning and tool invocation | Task completion rate, parameter-validation pass rate, false-trigger rate | Verify that whitelist constraints take effect |
| Experience | Real user scenarios | End-to-end latency, interruption rate, user adoption rate | Run control experiments against the cloud approach |
6.2 Five Practice Principles
- Default on-device, cloud on demand: complete work on-device by default, going to the cloud only when the device can’t meet the latency or capability requirement;
- Privacy grading: split processing paths by data sensitivity, keeping sensitive data on the device;
- Graceful degradation: automatically fall back to the cloud or to traditional rule logic when on-device inference fails, avoiding an unusable feature;
- Version control: keep both the model manifest and prompt templates under version management, supporting staged rollouts and one-click rollback;
- User control: provide clear switches and memory-management capabilities, ensuring features can be turned off and data can be deleted.
7. Conclusion
The model identifiers and version records in the beta code reflect a shift in the center of gravity: from “cloud large models” toward “edge-cloud collaboration.”
- The core competitiveness of on-device models lies not in parameter count but in the fine-grained balance among memory budget, backend adaptation, agent scheduling, and privacy boundaries.
- This balance requires a unified abstraction layer to carry it: shielding the upper layer from different models and backends, managing versions and staged rollouts below, and safeguarding security and observability on the side.
- This “configuration-driven, capability-tagged, rollback-ready” design approach applies equally to model registration, routing, and staged rollout on server-side AI inference platforms, giving it cross-device reuse value.
For engineering teams, what ultimately determines the success or failure of on-device AI is whether the evaluation system and observability are built on solid ground.
