All examples
Language models

Inspect and reverse a checkpoint edit

Define a local checkpoint edit with verified source and restoration.

llm_weight_space.aner
// Native checkpoint adaptation: inspect and check before publishing a new artifact.
// Paths identify local files; obtain and verify the research assets separately.
// This example defines the workflow without downloading weights or running it.
import aner.llm

fn apply_weight_edit(base: String, patch: String, out_dir: String) -> String {
    print(llm.weight_inspect(path: base))
    print(llm.weight_check(base: base, patch: patch))
    return llm.weight_apply(base: base, patch: patch, out_dir: out_dir)
}

fn reverse_weight_edit(transaction: String, out_dir: String) -> String {
    return llm.weight_revert(transaction: transaction, out_dir: out_dir)
}

print("Weight-space workflow ready: supply a verified base, declarative patch, and new output directory.")

Make it your experiment.

Use Aner 0.0.3 or newer. Save this program as examples/llm_weight_space.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/llm_weight_space.aner
aner run examples/llm_weight_space.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Use the compatible native Aner development engine with aner.llm, aner.secrets and VS Code extension 0.1.34 or newer. Checking makes no inference request; running sends the prompt to the explicit provider. Local examples require the named model to be installed or served already. Cloud requests require a configured opaque credential reference and can incur provider charges. See Language model connections and Credentials for supported adapters, HTTPS, timeout, content inspection and storage boundaries.

Credential setup
aner check examples/llm_weight_space.aner
aner run examples/llm_weight_space.aner

Client construction and syntax checking send no inference request. Running this program calls its explicit model service. Inspect the returned finish reason and reported usage; unavailable token counts remain unknown and usage does not verify charges.

Read token accounting and provider requirements
Install Aner