Functional AI is coming soon. Join the waitlist for early access.

fn.yml spec

A function is defined by a single fn.yml file. It is the source of truth for its interface and behavior.

name: classify
version: 3
model: claude-opus-4-8

input:
  ticket: file

output:
  category: string
  priority: enum[low, high]
  confidence: number

eval:
  dataset: ./tickets.jsonl
  threshold: 0.95
  runs: 5

Fields

FieldTypeRequiredDescription
namestringyesFunction identifier, lowercase, URL-safe
versionintegeryesMonotonic version number
modelstringyesTarget model id
inputmap of typed fieldsyesNamed, typed inputs
outputmap of typed fieldsyesNamed, typed outputs (the structured result)
evalobjectnoDataset, threshold, and run count

Field types

Inputs and outputs are typed. Supported types:

TypeNotes
stringUTF-8 text
numberFloating point
booleantrue / false
enum[a, b, ...]One of a fixed set of string values
fileA file reference (PDF, CSV, log, image)
array[<type>]A list of any of the above

TypeScript types

The compiled function's I/O is also available as TypeScript, generated by fn types:

export interface ClassifyInput {
  ticket: File;
}

export interface ClassifyOutput {
  category: string;
  priority: "low" | "high";
  confidence: number;
}