DocsReference

Glossary

Every noun of the product in a sentence or two, with the page that owns it.

People

TermMeaningPage
CallerWhoever opens a run: a person at the console, a developer through the SDK, or a program by CPI. The caller pays the run’s budget.Introduction
OpenerThe account that signed open_run, recorded in the run account: a wallet, or a program’s PDA. Only the opener cancels and closes the run.Runs and turns
CrankerWhoever lands turns. A wallet turning one run by hand is a cranker, and so is a process that turns every open run. Each turn pays its cranker the turn reward.Run a cranker
PublisherThe wallet that put a model on chain. It uploads the weights, seals the model, sets the royalty and claims from the model’s vault.Publish a model
AuthorityThe wallet recorded in Config that sets the turn reward and the protocol share rate.Instructions

Models and weights

TermMeaningPage
ModelA language model on chain: a Model account with its configuration, publisher and royalty, and the weight accounts it names. The program runs any model of the llama2.c architecture family from that configuration.Models
WeightsThe model’s numbers: int8 matrix rows with one fixed-point scale per row, plus the tokenizer and the lookup tables the integer arithmetic reads.Weight format
Weight accountAn account that holds one section of a model’s weights after a 2,048-byte header. Runs read weight accounts and never write them.Accounts
SectionOne part of the weights, held in one weight account. Section zero holds the tokenizer and the tables, and the other sections hold matrices. A turn names section zero and up to two matrix sections.Weight format
Weight fileThe file curta convert writes from a llama2.c checkpoint and its tokenizer: the weights in Curta’s integer format, cut into sections.Weight format
Weights hashThe 32-byte commitment to every byte of the weights, declared when the model is created and checked by the program during sealing.Publish a model
SealedThe state of a model whose weights the program has checked against the weights hash. A sealed model never changes and is the only kind a run opens on.Publish a model
RegistryEvery model on the program, listed at /models with configuration, royalty, runs and tokens produced.Models
Genesis modelsstories260K and stories15M, Karpathy’s TinyStories checkpoints in the llama2.c architecture.Models
TokenizerThe vocabulary and merge scores stored in section zero. The program uses it to turn the prompt into tokens and each generated token into text.Weight format
VocabularyThe set of tokens a model knows. The classifier scores every entry of it for each generated token.Models
Context lengthThe most positions a model attends over. A run’s prompt tokens and max tokens fit within it.Models

Runs and turns

TermMeaningPage
RunOne execution of a model on one prompt. A run is an account that holds the prompt, the parameters, the budget, the working state of the forward pass and the output.Runs and turns
TurnOne transaction, signed by anyone, that advances a run’s forward pass as far as one transaction’s compute allows and pays its signer the turn reward.Runs and turns
TokenA model token: one entry of the vocabulary, as an id and a piece of text. The product’s own token is always written CURTA.How it works
PromptThe text a run continues: UTF-8 of up to 1,024 bytes, stored in the run account and tokenized by the program.Quickstart
Max tokensThe most tokens a run generates, from 1 to the model’s context length.Quickstart
TemperatureA number from 0 to 16 that the sampler applies to the scores. Zero takes the highest-scoring token.How it works
SeedAn unsigned 64-bit integer that starts the on-chain generator the sampler draws from.How it works
End tokenThe token that ends a run before max tokens. Its id stays in the output ids and adds no text.How it works
RunningTurns are landing.Runs and turns
StarvedThe budget cannot pay the next turn. Anyone can fund it.Runs and turns
CompleteThe run reached the end token or its max tokens.Runs and turns
CancelledThe caller stopped it at a turn boundary.Runs and turns
SettledThe flag a run carries once settle has moved its accrued royalty and protocol share. A settled run can be closed.Runs and turns
FundAdding SOL to the budget of a running or starved run. Anyone can fund any open run.Runs and turns
CancelThe opener stopping a running or starved run at a turn boundary. What the run accrued stays for settlement.Runs and turns
SettleMoving an ended run’s accrued royalty to the model’s vault and its accrued protocol share to the fee account, once, by anyone.Runs and turns
CloseThe opener closing a settled run’s account. Every lamport left in it, the rent and the unspent budget, returns to the opener.Runs and turns
ReplayRecomputing a run off chain from the on-chain weights, the prompt, the parameters and the seed, and comparing it with the chain’s output token by token.Replay
EventThe record the program emits with every state change, as a signed call to itself: the action, the accounts, the amounts and the ids of the tokens a turn completed.Events

The computation

TermMeaningPage
Forward passThe computation that produces a token: embedding, every layer’s attention and feed-forward block, the classifier and the sampler. Curta runs all of it in the program.How it works
PositionOne place in the sequence the model reads: a prompt token or a generated token. Each position passes through every layer.How it works
StageOne step of the forward pass, numbered from 0 to 20 in the run’s cursor: tokenizing, embedding, the steps of a layer, the classifier, sampling.How it works
CursorThe run’s place in the forward pass: stage, layer, row and position. Every turn starts from it and writes it back.How it works
Turn plannerThe part of the inference core that decides where a turn ends and which weight accounts it reads. The program, the sender and the quote all run it.How it works
ChunkThe unit the planner fills a turn with: a run of rows of one matrix, of positions in an attention stage, or of vocabulary entries in the sampler.Inference core
Compute unitSolana’s measure of a transaction’s computation. One transaction may use 1,400,000, and the planner fills each turn close to that.How it works
Multiply-accumulateOne weight times one activation, added to a sum: the operation the matrices are made of and the unit their compute cost is measured in.Inference core
Attention cacheThe key and value vectors of every layer at every position a run has passed, kept in the run account so later positions attend over them.How it works
Fixed pointIntegers that stand for fractions by a fixed number of fractional bits. Activations carry 16 of them, so the same inputs give the same bytes on every machine.Inference core
SamplerThe stage that chooses the next token from the classifier’s scores: the highest at temperature zero, a seeded draw above it.How it works

Money

TermMeaningPage
BudgetThe SOL a run can spend, deposited into the run account at open and added to by fund. Every fee is paid from it.Fees
Turn rewardA fixed amount per turn, paid from the run to the turn’s signer inside the turn’s own transaction.Fees
RoyaltyA price per generated token set by the model’s publisher, accrued in the run and moved to the model’s vault at settlement.Fees
Protocol shareA share of turn rewards and royalties, at a rate in basis points, accrued in the run and moved to the fee account at settlement.Fees
QuoteThe cost of a run computed before it opens: turns, turn rewards, royalties, protocol share, total budget, and the run account’s size and rent.Fees
Next turn costThe amount the run account reserves for its next turn. A run whose remaining budget is below it is starved.Runs and turns
RentThe SOL an account holds for its size. A run’s rent is deposited beside the budget at open and returns whole on close.Fees
LamportThe smallest unit of SOL: one billionth. Every amount in the program and the SDK is in lamports.Fees
Basis pointOne hundredth of a percent. The protocol share rate is a count of them, from 0 to 10,000.Fees
CURTAThe product’s token, with a supply of 1,000,000,000. The protocol share that accrues in the fee account buys CURTA on the market and burns it.CURTA

Accounts

TermMeaningPage
ConfigThe program’s one configuration account: the authority, the fee account’s address, the turn reward and the protocol share rate.Accounts
Model accountA 4,096-byte account with a model’s publisher, configuration, royalty, weights hash, sealed flag, counters and the list of its weight accounts.Accounts
Model vaultThe account, one per model, that receives the model’s royalties at settlement. The publisher claims from it.Accounts
Run accountA 256-byte header of run and budget fields followed by the inference core’s working state. It is created at its full size before the run opens.Accounts
Fee accountThe FeeVault: the program’s one account that receives the protocol share at settlement.Accounts
PDAA program derived address: an account address a program signs for. Config, the fee account and each model vault are PDAs of the curta program, and a program that calls Curta opens runs from one of its own.Call from a program

Tools

TermMeaningPage
Programcurta, the Solana program that holds every account above and executes every instruction, the forward pass included.Instructions
InstructionOne of the program’s 13 entry points, from init_config to close_run.Instructions
Inference corecurta-core, the Rust crate with the weight format, the forward pass, the tokenizer, the sampler and the turn planner. It builds into the program, the CLI and the browser.Inference core
SDK@curta/sdk, the TypeScript client for Node and the browser, with the WebAssembly build of the inference core inside it.SDK reference
CPIA cross-program invocation: one Solana program calling another inside a transaction. A program opens, cancels and closes runs by CPI.Call from a program
CPI cratecurta-cpi, the Rust crate a program calls Curta with and reads a run account through.Call from a program
CLIcurta, the command line tool: convert, publish, seal, set-royalty, claim, crank and run.CLI reference
ConsoleThe page at /run where a person picks a model, types a prompt, reads the quote, opens a run and watches it turn.Quickstart
oracle-of-storiesThe example caller program. It asks the model for a line by CPI and stores it in its own account.Call from a program