Publish a model
The path from a llama2.c checkpoint to a sealed model that earns a royalty on every token.
Convert the checkpoint
curta convert <checkpoint> --tokenizer <file> --out <artifact>The command reads a llama2.c checkpoint and its tokenizer file and writes the model in Curta’s integer weight format to the --out path. It prints one JSON object:
| Field | Value |
|---|---|
| artifact | The path of the converted file. |
| bytes | Its size. |
| hash | The weights hash the model declares on chain. |
| config | Dimension, hidden dimension, layers, heads, key and value heads, vocabulary and context. |
| sections | The size of each section, one weight account each. |
| turns | The turns an 8-token run on the prompt “Once upon a time” takes. |
Models and the weight format describes the format and the models it holds.
Publish the weights
curta publish <artifact> --name <name> --royalty <lamports>The command creates the model account and one weight account per section, then writes the weights in 800-byte chunks, one write_weights transaction per chunk, 24 in flight at a time. The wallet that signs is the model’s publisher. Quickstart lists the flags that choose the wallet and the cluster.
| Flag | Value | Default |
|---|---|---|
| --name | The model’s name, up to 64 bytes. | The artifact’s file name without its extension. |
| --royalty | The royalty per token, in lamports. | 0 |
| --state | The file that holds the upload’s state. | keys/<artifact>.upload.json |
Each weight account records which chunks it holds in a bitmap. Running the same command again reads the bitmaps and sends only the chunks still to write. The state file holds the keypairs of the model account and the weight accounts, saved before the first transaction, so the second run addresses the same accounts.
Progress goes to stderr as bytes uploaded against the total. At the end the command prints the model’s address, the weight bytes, the rent paid in lamports and the count of transactions.
Rent for the weights
The publisher pays the rent of the model’s accounts in SOL when curta publish creates them. Rent is 5,080 lamports per byte, so one megabyte of weights takes 5.08 SOL.
Seal the model
curta seal <model>The command sends seal_model transactions until the model is sealed and prints how many it sent. Each one hashes the next 65,536 bytes of the written weights, and the last one compares the result with the weights hash. The first one closes the model to writes.
Once sealed, the model appears in the picker on /run and callers open runs on it. The Seal button on /publish sends the same instruction.
| Model | Upload transactions | Seal transactions |
|---|---|---|
| stories260K | 450 | 7 |
| stories15M | 20,642 | 304 |
Set the royalty
curta set-royalty <model> <lamports>The command sets the royalty per token, in lamports, and prints the transaction’s signature. Every quote for a run opened from then on includes it, and Fees tells when it reaches the vault.
Claim royalties
curta claim <model> [lamports]The command moves royalties from the model’s vault to the publisher’s wallet. With an amount it claims that many lamports, and without one it claims the vault’s whole balance above its rent. A claim works at any time.
Follow it on /publish
Connect the publisher’s wallet on /publish. The page lists the wallet’s models and shows, for each one:
- bytes written against the total while the upload runs
- Seal, when every byte is written
- the royalty field with Set royalty
- the vault balance with Claim
The model’s own page shows the same upload progress to everyone.