Skip to content

Quick Reference

A single-page cheat sheet of all field names, defaults, valid values, built-in functions, and template tags.

Types used in this table: number = like 42, string = text like "hello", boolean = true or false, array = a list of values like ["a", "b", "c"].

Top-level config keys

KeyTypeDescription
variablesarrayVariable definitions
functionsarrayCustom function definitions
classifiersarrayClassifier definitions
generatorsarrayGenerator definitions
contentarrayContent rule definitions

Variable fields

FieldRequiredDefaultDescription
nameyesIdentifier used in expressions
initialValueyesExpression for starting value
perTurnUpdateno(none)Expression evaluated at turn start, before input classifiers
postInputUpdateno(none)Expression evaluated after input classifiers run
preResponseUpdateno(none)Expression evaluated when bot reply arrives, before response classifiers
postResponseUpdateno(none)Expression evaluated after response classifiers run

Function fields

FieldRequiredDescription
nameyesIdentifier used to call the function
parametersnoComma-separated parameter list
bodyyesmathjs expression (or full JS with return) — see Advanced mode

Classifier fields

FieldRequiredDefaultDescription
nameyesUnique name
conditionno(always)Expression; classifier skipped if falsy
inputTemplateno(no input classification)Template for classifying user messages
inputHypothesisnoHypothesis for input; {} replaced by label
responseTemplateno(no response classification)Template for classifying bot replies
responseHypothesisnoHypothesis for response; {} replaced by label
useLlmnofalseUse chat LLM instead of zero-shot model
useHistorynofalseInclude chat history in LLM request
historyContextSizeno0Max tokens of history to include (0 = preset)
dependenciesno(none)Comma-separated names that must run first

Classification (per label) fields

FieldRequiredDefaultDescription
labelyesText substituted into hypothesis (or expression if dynamic: true)
conditionno(always)Expression; label excluded from task if falsy
categoryno(none)Labels sharing a category compete; highest wins
thresholdno0.7Minimum score (0–1) to trigger updates
dynamicnofalseIf true, label is an expression returning string or array
updatesno[]Array of {variable, setTo} updates to apply

Generator fields

FieldRequiredDefaultDescription
nameyesUnique name
typeno"Text""Text", "Image", or "Image-to-Image"
phaseyes"On Input" or "On Response"
conditionno(always)Expression; generator skipped if falsy
lazynofalseStored but currently has no effect — stage always waits for all generators
promptnoExpression for the generation prompt
dependenciesno(none)Comma-separated names that must run first
updatesno[]Array of {variable, setTo} updates; {{content}} = result

Text generator additional fields

FieldDefaultDescription
includeHistoryfalseInclude chat history in request
historyContextSize0Max tokens of history (0 = preset)
minTokens"50"Minimum response tokens
maxTokens"250"Maximum response tokens
stoppingStrings""Comma-delimited strings that end the response
retryCondition""Expression; if truthy, retry (max 3)

Image generator additional fields

FieldDefaultDescription
negativePromptContent to exclude
aspectRatioSee valid values below
removeBackgroundfalseAttempt background removal

Aspect ratio valid values

"21:9", "16:9", "3:2", "5:4", "1:1", "4:5", "2:3", "9:16", "9:21"

Image-to-Image additional fields

FieldDefaultDescription
sourceImageUrlExpression evaluating to image URL
imageToImageType"edit""edit", "canny", or "face" — see Gotchas
removeBackgroundfalseAttempt background removal

Content rule fields

FieldRequiredDefaultDescription
categoryyes"Input", "Post Input", "Stage Direction", "Response", "Post Response"
conditionno(always)Expression; rule skipped if falsy
modificationno"{{content}}"Expression for the new content; {{content}} = current content

Statosphere built-in functions

FunctionReturnsNotes
split(string, separator)arraySplits string by separator
contains(haystack, needle)booleanWorks for strings and arrays
capture(string, regex, regexFlags?)arrayAll capture groups of all matches; optional flags (default "g")
replace(input, regex, newValue)stringHas a bug — see Gotchas
join(array, separator)stringJoins array elements
substring(string, start, end)stringZero-based, end exclusive
isNull(value)booleanTrue if null or undefined
isNotNull(value)booleanTrue if not null or undefined

All mathjs functions are also available: abs, ceil, floor, round, min, max, mean, random, and many more.

Template tags

TagReplaced with
{{user}}Current user's name
{{char}}Character's name
{{persona}}User's persona description
{{personality}}Character's personality field
{{scenario}}Scenario field
{{content}}Current message being processed
{{variableName}}Value of any variable (case-insensitive)

Tags must appear inside string literals in expressions: "Hello, {{user}}!".

Special variables

NameEffect
backgroundURL is applied as the chat background image
debugModeIf truthy, enables verbose console logging