.f0rge/wiki/docs/capabilities/index.md 2.7 KiB 89 lines Raw

Capability pages

One page for each capability. A page is the whole vocabulary: the parts it accepts, the parameters it reads, the channels it emits, and the terminal metadata. The core reads none of it.

spec.md section 7 holds the summary table. A page must agree with that table. If they disagree, the table is right and the page is a bug.

Pages

pagecapabilitystatus
chat.v1.mdchatwritten
embed.v1.mdembedwritten
rerank.v1.mdrerankwritten
tts.v1.mdttswritten
stt.v1.mdsttwritten
music.v1.mdmusicwritten
image-gen.v1.mdimage-genwritten
image-edit.v1.mdimage-editwritten
t2v-gen.v1.mdt2v-genwritten
i2v-gen.v1.mdi2v-genwritten
decide.v1.mddecidewritten
extract.v1.mdextractwritten

Shared media types

A page names one mime for each channel. These are the only allowed values.

usemime
text fragmenttext/plain; charset=utf-8
structured objectapplication/json
vector, score, token listapplication/cbor
audioaudio/pcm; enc=<s16le|f32le>; rate=<hz>; channels=<n>
one imageimage/png, image/jpeg, image/webp
one clipvideo/mp4

A pcm event states its format in its own mime. Every pcm event of one job uses the same mime.

Shared usage keys

done.usage counts what the job consumed and produced. The keys are integers. A page lists the keys that its capability reports.

keymeaning
tokens_inprompt tokens
tokens_outgenerated tokens
audio_msaudio milliseconds, in or out
imagesimages produced
pixelspixels produced
framesvideo frames produced

Shared progress payload

A progress event carries {"stage": string, "pct": number}. pct is between 0 and 1. It never decreases inside one job.

Shape goldens are generated

Do not write a golden by hand. .f0rge/ci/shape_goldens.py reads the tables in each page and writes goldens/capabilities/<name>.v1.json; 04_shape.sh runs it with --check. CI fails when the result differs from the committed one. One source, one artifact, and a page cannot drift from its golden.

A page therefore has no Golden: line. The path is derived from the capability name.

Page contract

Every page has these sections, in this order:

  1. title, then the five status lines: Status, Capability key, Route, Crate, Trait
  2. Parts in
  3. Parameters
  4. Channels out
  5. Terminal metadata
  6. Request
  7. Response, no stream
  8. Stream
  9. Rules

A capability with no parameters says so. It does not keep an empty table. A parameter with only one legal value is not a parameter; it is a constant, and the page states it in a rule.

view raw