Overview
These Files drive routes move models, datasets and checkpoints between the owner’s computers and phones, and send single files to another computer’s Inbox. They are part of the Files drive protocol (files/2) on the runtime, under the same base URL and with the same sign-in as the Files Drive API. The full contract is section 19 of contracts/files-drive/SPEC.md in the platform repo.
Like the rest of the Files drive, these routes are off unless the runtime runs with
ALLTERNIT_FILES_DRIVE=1.Copying is not running
A model package has two separate permissions:- transfer: the files may be copied to another device.
- execute: a model engine may load and run them.
execute=true on the hand-off), and the receiver allowed it (allow_execute: true on the transfer). Otherwise the copy lands with execute: false.
Each copied package carries a permission file, .allternit-package.json, in its folder. When a model is imported or launched through POST /api/local-engine/models/import or POST /api/local-engine/runtimes/launch, the runtime reads that file. A package with execute: false, or with a permission file that can’t be read, is refused:
Get a hand-off
item_id is a package folder or a single file (such as one .gguf). The response is the package manifest: every file with its size, blake3 content_hash, sha256 and item_id, plus the grant and the source.
execute comes back true only when you asked for it, you are the owner or one of your own devices, and the package can run on the source. A phone reads the hand-off, pulls each file’s chunks (GET /items/:item_id/manifest, GET /chunks/:hash), checks every hash, and hands the folder to its on-device model importer.
Copy a package to this computer
Call this on the computer that should receive the package:source.transportis optional. Leave it out to copy from this computer (whencomputer_idis its own) or through the cloud relay. Aloopbackormeshtransport must point at a loopback or tailnet address ending in/api/v1/files/v2.dest_parent_iddefaults to~/Allternit/Downloads/Models.- Only the chunks this computer does not already have are downloaded, and every chunk and file is checked as it lands.
GET /api/v1/files/v2/jobs/:job_id until state is done or failed:
Allow a copied model to run
Send a file to a computer
dest_root_id. Folders are refused; send a folder as a package instead. Files in the Inbox are treated as untrusted, so an agent acts on them only after approval. The response is a copy job.