Model delivery

Safely Side-Load a Local Model Artifact

Validate source, revision, length, digest, format, and runtime load before activation.

Review status: Fact and editorial QA complete; owner review pending · 2026-10-05 · Fact IDs: COVE-MODEL-02, PRIVACY-01

Direct answer

A side-loaded model should be treated as untrusted user-selected input until the application establishes that it is readable, in an explicitly supported format, within resource limits, and eligible for activation under the product’s policy. Use Android’s user-mediated document selection rather than broad filesystem access when that fits the task. Copy or stream the selected content into an application-controlled candidate location, retain only the access grant needed for the workflow, validate it using a format-aware parser and an expected manifest when available, then offer activation only after the configured checks pass. A filename, extension, provider MIME label, or successful copy is not proof of model identity, safe structure, authenticity, license, or runtime compatibility. This is not the same problem as checking a known remote artifact. A configured download can have a pinned revision and an expected size or digest from a trusted manifest. A file selected by a person may arrive without a trustworthy manifest, may be renamed, may have incomplete provenance, and may use a format the application does not understand. The UX must say what the application can verify and what it cannot. In the current Cove facts, the model configuration’s SHA-256 value is empty, so site content must not claim that Cove verifies a distributed model hash. A generic engineering guide can describe a safe validation workflow without claiming Cove supports model imports or distributes a particular file. Keep selection, inspection, and activation as separate phases. Selection tells the app which document the person chose. Inspection checks the opened stream and parsed metadata. Validation compares available identity fields, size bounds, supported format, and runtime requirements. Activation changes which artifact the inference subsystem may load. Failure in any earlier phase should leave the active model unchanged. A selected file should not trigger native parsing in the main thread or immediately replace the working artifact. Use a candidate path and bounded resource policy; close streams deterministically, report a recoverable error, and clean only app-owned temporary model data when the user cancels or validation fails. Document providers are diverse. They may report a generic MIME type, omit size metadata, expose a cloud-backed document, or make content available through a URI rather than a filesystem path. Treat provider metadata as hints for user experience and early filtering, not as final content proof. Open the URI through the granted content resolver, handle access revocation or provider failure, and do not convert an opaque document URI into a guessed file path. If the app persists a URI permission to support later access, explain that behavior and test revocation. If instead it copies the bytes into app-specific storage, explain the additional storage footprint and deletion policy and ensure the copied candidate cannot escape application ownership unexpectedly. Validation should be layered and explicit. First enforce a maximum accepted byte count that is a product safety limit, not a compatibility claim. Then inspect the file signature or parse the actual model container using a maintained parser; extensions and MIME labels alone are insufficient. Extract only metadata the format safely exposes, compare model identifier, revision, tensor or tokenizer metadata, and expected architecture against a supported manifest when one exists. Validate paths and archive members if the chosen format is a container; reject traversal names, duplicate entries, unexpected files, malformed lengths, and decompression behavior that exceeds limits. Avoid trying to parse arbitrary bytes in a privileged or network-enabled context. Parsing success still does not prove that a runtime can load the model, so run an isolated compatibility/load check before activation. Integrity and provenance are different. A cryptographic digest detects whether bytes match an independently trusted expected digest. If the expected digest comes from the same untrusted file, it cannot establish origin. TLS used to download a file can protect a connection but does not establish a third-party model’s license or compatibility. A checksum displayed by an untrusted forum is not automatically a trust anchor. Record where the expected value came from, which revision it covers, and whether the comparison ran. If no trusted expected digest exists, describe validation narrowly: format parser passed, size fit limits, manifest identity matched if available, and runtime load succeeded or failed. Do not label the result “authentic” or “safe” without a defined basis. License and user authorization are another boundary. A file being present on a device does not prove that the person has rights to use or redistribute it. Ask the model provider or publisher for the applicable license and preserve that evidence with artifact metadata if a product makes a policy decision from it. Do not infer commercial permission from a public download link, and do not turn a technical hash check into a license check. If the product cannot establish a required license condition, explain the limitation and keep activation disabled where policy requires it. Do not upload the selected file for validation unless the product separately discloses that data flow and has explicit authorization; on-device validation should remain local if that is the promised design.

User chooses a model document from local storage

The selected provider reports a generic MIME type and no reliable size, while the application already has a working model. The chosen file’s origin, format, and license evidence are not automatically known.

Decision

Use explicit document selection, stage the bytes as an isolated candidate, validate actual content and available provenance, and preserve the current model until the intended runtime and policy checks succeed.

Expected outcome

The user sees which facts are established and which remain unknown; invalid or unsupported bytes never reach the active inference path.

Evidence to collect

The claim becomes reviewable only when the following evidence is attached to the same artifact and test run:

  • Source provenance
  • Manifest verification
  • Rejected-artifact cases

A completed byte stream is not enough. Final placement, integrity, runtime load, and recovery must also pass.

Implementation workflow

  1. Publish a precise import contract. Document supported file containers, maximum accepted bytes, required metadata, runtime requirements, and whether a trusted manifest or digest is mandatory. Reject formats without a maintained parser or an explicit compatibility policy instead of guessing from an extension.
  2. Select through the Android document flow. Start only after an explicit user action and read the returned content URI through its granted resolver. Handle missing size metadata, provider errors, revoked access, and cancellation without broad storage permission requests or guessed filesystem paths.
  3. Stage an isolated candidate. Copy or stream into a unique app-owned temporary path, enforce the configured byte ceiling while reading, and close descriptors on all success and failure paths. Do not let the active inference runtime open a file that is still being copied or inspected.
  4. Validate content and trust separately. Parse actual bytes under structural limits, compare available revision and architecture metadata with an approved manifest, record where an expected digest came from, and assess license evidence separately. A provider label, filename, adjacent hash, or URL does not prove all of these facts.
  5. Test the intended runtime before switching. Load the candidate in a controlled compatibility check and keep the existing artifact selected until it succeeds. If parsing passes but runtime initialization or the target task fails, report that distinction and retain the prior model.
  6. Explain the result and clean safely. Show passed, failed, and unknown checks distinctly; provide retry or choose-another-file actions; remove only app-owned candidate bytes when appropriate; and verify that URI revocation and cleanup do not delete conversations or other user data.

Keep each transition observable. A failure should identify the stage, artifact, runtime, and recovery action without logging private user content.

Acceptance criteria

  • Import begins only after the user selects a document and consumes its granted URI rather than a guessed path or unnecessary broad storage access.
  • Provider MIME type and filename are hints only; actual bytes pass format-aware parsing and size/structure limits before runtime access.
  • A candidate cannot replace the active model until applicable identity, provenance or manifest policy, and runtime-load checks pass.
  • The interface and diagnostics distinguish established facts from unknown origin, absent trusted digest, unreviewed rights, and unsupported runtime; selected content is not uploaded or logged.

Decision table

DimensionChoice or evidenceHow to interpret it
Pinned remote artifactUse a configured manifest to identify an expected revision and metadata.Response bytes and runtime compatibility still need independent checks.
User-selected document URIThe person selected a provider document and Android granted access.Selection does not establish MIME correctness, origin, rights, format, or compatibility.
Bundled application assetThe build packages the asset with the application.Presence in the package does not prove runtime compatibility or rights for every use.

Failure patterns to prevent

  • Trusting filenames
  • Loading arbitrary bytes automatically

Also prevent silent fallback, unpinned artifacts, missing cancellation, and conclusions that combine unlike configurations. Store unsuccessful runs alongside successful ones.

Minimum reproducibility record

LayerRecord
DeviceManufacturer, model, chipset, RAM class, operating-system build
SoftwareApplication version and git commit
ModelFamily, variant, revision, format, file length, hash, quantization
RuntimeName, revision, requested backend, observed backend evidence
WorkloadFixture revision, input hash, prompt hash, output policy
OutcomeCompleted, failed, cancelled, fallback, and privacy-safe diagnostics

Release checklist

  • ☐ The primary query is answered without an unsupported number.
  • ☐ Every artifact and runtime is pinned.
  • ☐ The representative task and failure policy are explicit.
  • ☐ Lifecycle, cancellation, cleanup, and fallback are tested.
  • ☐ User-content and network boundaries are documented.
  • ☐ Result wording applies only to the recorded configuration.
  • ☐ The page links to raw method or evidence when results are added.

Sources and related evidence

Chinese deployment and troubleshooting content is organized in the .奇连 AI 端侧专题.

Frequently asked questions

Is a document provider MIME type enough to accept a model?

No. Providers can report generic or missing metadata. Use MIME and extension for early filtering only, then inspect actual bytes with a format-aware validator and enforce size and structure limits before the runtime opens the candidate.

Does SHA-256 prove that a side-loaded model is authentic?

Only when the expected digest comes from an independent trusted source and is tied to the exact revision. A digest shipped beside the same untrusted file establishes no origin by itself.

Can a model be activated as soon as parsing succeeds?

Not necessarily. A parser may recognize a format that the application’s runtime cannot load or use for the intended task. Keep it as a candidate through the runtime check and preserve the active model until that gate passes.