Documentation

The graph, in concepts.

flowg is small at its core: a closed set of node kinds, a set of wire kinds, and one extension point. Everything else composes from those.

Core types

FunctionGraph
The IR. A DAG of nodes and wires with a name, output node, and return type. ProgramGraph bundles functions, an entry point, and per-function effect-allow declarations.
GraphNode
The node enum: Param, Literal, TensorLiteral, Apply{op}, Select, WhileLoop, Call, Match, CodeBlock, capability and concurrency nodes, and more.
OpKind
The operation an Apply performs: arithmetic / comparison / logic primitives, plus Custom(String) — the open extension point every kernel hooks (matmul, ssm_scan, rms_norm…).
WireKind
Edge semantics: Move (default), Borrow, MutBorrow, Copy, Channel, Shared, Weak, Stream, Error, Lazy, Feedback. Ownership, generalized.
TensorLiteralData
A shaped, typed constant. Weights stay out-of-band in a safetensors sidecar and are reattached by name.
CapabilityRef
A gated call: capability id + version + slot + method + effects. No ambient authority; effects are checked at dispatch.

Command line

flowg --help
flowg inspect <file.fg> Print a graph’s nodes, wires, and types.
flowg run <file.fg> [--receipt] Execute a graph; optionally emit an energy receipt.
flowg make-sample Emit a small sample .fg to learn the format.
flowg-serve OpenAI-compatible inference server over the model zoo.

Going deeper