Settings
The settings of the platform: the levels they are set at, the owners of the keys, the settings window, the languages of the interface and the list of all keys.
Introduction
The document describes where the values of settings come from, the owners of the keys, how settings are shown to the person and how the languages of the interface are made. The values are kept by the function settings, the texts are gathered by the function i18n, the meaning of each key is set by its owner. The file format — File formats, section 8, the methods — Methods of the platform services, section 1.
1 Levels
A value is looked for from the narrow level to the wide one and taken from the first level where it is set. In table 1 the levels are listed from wide to narrow.
Table 1 — Levels
| Level | Where it is kept | Who writes it |
|---|---|---|
| default of the schema | in the schema of the key | the owner of the key |
core |
data/config/core.json, only the keys core.* |
the settings window; the kernel makes an empty file at its first start |
system |
data/config/system.json |
by hand; the workshop does not write this level. The level is kept although an instance serves one person: it may be needed for the settings of the machine apart from the settings of the person |
user |
data/config/user.json |
the settings window |
process |
data/processes/<id>/settings.json |
the settings of the process |
session |
in the memory of the function of settings, not in a file | holds until the function is restarted |
There is no level of module settings: what the person sets for a module are the parameters of the node (Modules, section 10).
The keys core.* at any level but session are written into core.json. A key with restart: true in its schema takes effect at the next start; the platform does not show it as applied at once.
2 The schema of settings
Each owner describes its settings in one schema file settings.schema.json beside its code (The make-up of the platform); the program builds it in. There are no other places where the default or the limits of a setting are written — neither in the code of the owner, nor in the function of settings, nor in the window (rule 2.2 of Rules of development). The file format — File formats, section 8.
The schema divides the settings of the owner into subsections. Each key in it has:
type—string,integer,number(a fraction: a share, millimetres, the temperature of a model),string[]orcolor(#RGB/#RRGGBB);default— the default value;default_by— optional: a default that depends on the value of another key of the same owner. So the colours of the shell follow the chosen colour scheme;restart— whether a restart is needed for the value to take effect;- for numbers —
minandmax, for a closed set of values —choices.
The texts of a setting are kept in the dictionaries of the owner, not in the schema, and are named by a rule; the names of the texts are not written separately (table 2).
Table 2 — The texts of a setting in the dictionaries
| Text | Key of the dictionary |
|---|---|
| the name of the setting | setting.<key>.title |
| the explanation: purpose, unit, special values (for example, «0 — off») and when a change takes effect; the limits and the default of the schema are not in it — the settings window shows them from the schema | setting.<key>.help |
| the name of a value from a closed set | setting.<key>.choice.<value> |
| the name of a subsection | setting.section.<id of the subsection> |
The check in make ci does not pass if a key of a schema lacks any of these texts in Russian or English, or if an explanation repeats a number of its schema — a limit or the default, except zero: such a copy would drift from the schema at its first change.
The code of an owner reads its setting through a common helper from the common code of the protocol. The helper asks the function of settings, and when there is no answer takes the default from the same schema file. The code has no fallback values of its own.
The exception is the values of the process level: these are free keys to put into the parameters of nodes (The program: graph and runs, section 15), and they have no schema. They are written by settings.set with the level process, and settings.get with process_id returns them as written (Methods of the platform services, section 1).
3 The owners of keys
The prefix of a key is the address of its owner (rule 2.4). The function of settings keeps values and checks them by the schema, but has no keys of its own: the meaning of each key is set by its owner.
Table 3 — The owners of keys
| Prefix | Owner | How the schema reaches the function of settings |
|---|---|---|
core.* |
the kernel | at its start the function of settings asks the kernel for the schema with the method core.settings.schema |
ui.* |
the function ui |
settings.schema.register |
i18n.* |
the function i18n |
settings.schema.register |
graph.*, modules.*, canvas.*, observe.*, sources.* and any other |
the function with this id | settings.schema.register |
An owner registers its schema at its start and again each time the function of settings comes up anew (the event function.ready): it keeps the schemas of the owners only while it works, and after its restart, without a new registration, the person's values would stop taking effect. An owner names settings in its description (requires, The make-up of the platform, 3.4.1); make ci checks it. An owner for whom the defaults of its schema are harmless names it as optional (optional) and works on the defaults until it comes — so the function i18n is made; to the graph and the function of modules the settings are required: their values decide what to keep and how many resources to take. Only one's own schema can be registered: the owner is named by the kernel, the sender of the call (Exchange with the kernel, section 3), and the schema of another owner is refused with settings_invalid_owner; the schema holds only keys with one's own prefix, a foreign key is refused with settings_invalid. Registering the same owner again replaces its schema whole.
The kernel starts before the function of settings and cannot ask it. So it reads the keys core.* itself: by its own schema, from core.json and system.json. If a value in these files does not fit the schema — a number out of bounds or a wrong type — the kernel does not start and names the file, the key, the value and the allowed values. It does the same with a file that cannot be parsed.
The function of settings checks by the schema what already lies in the files of the levels too: a file might have been changed by hand. It does not use an unfitting value — it takes the value from a wider level — and publishes the event settings.value_invalid with error_code: settings_value_invalid, the file and the key; by it the function of observation opens a problem.
4 Writing and reset
- A value is checked before it is written; if it does not fit, the old one stays.
- The file is written whole; after writing the event
settings.changedis published. - Reset removes a value from a level: the key is removed from the file or from the memory of the session, and the value is taken again from wider levels and from the schema. The default is not written into the file. A key is taken off the file its write at that level went to: a
core.*key — offcore.json, as it was written.
5 Secrets
The platform does not keep passwords and access keys. A setting whose name holds secret, password, token, api_key, apikey or private_key (capital and small letters alike) is refused with settings_secret_rejected. This guards against an accidental mistake and does not recognise secrets: the key openai_key passes the check (Protection, 3.5).
6 The settings window
- The section «State» stands first in the column of the window: whether the kernel works, which functions are connected, the latest errors and simple counters. This section is not a list of modules.
- Order. Then come the large sections (kernel, interface, other), inside them the subsections. Subsections are folded by default.
- Changing a value. A value is changed on the tab «Edit» of the panel of the chosen setting (The workshop, 5.1); the key
Enter, the button «Write» and going to another setting write the value, like leaving a field of a pulpit; a value that does not pass the check of the schema is not written. A value from a closed set is chosen from a list. - Help. Each row has a sign «?» that opens its explanation; the explanation, the key, the default and the allowed values are shown on the tab «Information».
- Reset. The button «Reset» on the tab «Edit» returns the default of the setting, the button «Reset all» — the defaults of the whole section.
- Restart. Settings that need a restart are marked.
7 Languages
- In code there are only the keys of strings; the texts themselves are in the JSON dictionaries of the owner of the text: the labels of the window — at the function
ui, the names of settings and the texts of errors — at the owner of the key or of the error code (rule 2.2). The functioni18ngathers the dictionaries but keeps no texts of others. - The language of the interface is the setting
i18n.language. Its owner is the functioni18n; the settings window writes it with an ordinarysettings.set, like any other, the language switch of the workshop — with the owner's commandi18n.language.set, and the workshop learns the language with the queryi18n.language.get, not knowing the key of the setting; the functioni18nreads it at every request and keeps no copy of the language of its own. - Dictionaries. Functions declare the folders of their dictionaries when they introduce themselves (
locales); a folder with a segment*means each such folder that exists at the moment of the question, so dictionaries that appeared during work are seen without a new declaration (Exchange with the kernel, section 4). The kernel gives their list with the querycore.localesand adds its own foldercore/kernel/localesto it; the functioni18nreads only these folders and its own. - The language of a module. A module learns the language in the message
init. The function of modules asks the owner for it with the queryi18n.language.getat every start of a module; without the functioni18nthe language ininitisnull, and the module speaks its default language. - A missing text for a key is a problem for diagnosis, not a refusal:
i18n.translategives the key itself instead of the text and publishes the eventi18n.key_missingwitherror_code: i18n_key_missing, by which the function of observation opens one problem per key. - The required languages are Russian and English; a new language is dictionaries, without code. There are no ready sets of settings switched on as a whole: the levels and reset already let one start anew.
8 List of keys
The section holds only the keys and their purpose. The type, the default, the allowed values and whether a restart is needed are written in one place — in the schema file of the owner — and are not repeated in the document: a change of a default is made in one file. The check in make ci does not pass if a key of a schema is not mentioned here, or a key is mentioned that is in no schema.
The kernel — core/kernel/settings.schema.json:
Table 4 — Settings keys of the kernel
| Key | Purpose |
|---|---|
core.connections_max |
how many parts of the program may be connected to the kernel at once |
core.rpc_queue |
how many requests of one part to keep in the queue |
core.document_max_bytes |
the largest size of one document |
core.function_start_timeout_ms |
how long to wait for a started function to introduce itself to the kernel |
core.health_interval_ms |
how often to ask the functions «are you alive?» |
core.health_timeout_ms |
how long to wait for the answer «alive» |
core.function_restart_max |
how many times in a row to restart a fallen function |
core.function_restart_base_ms |
the pause before the first restart, doubled after |
core.shutdown_grace_ms |
how long to wait for a calm stop of the instance |
core.process_stop_grace_ms |
from the request to stop to the forced stop of a program started by a part of the platform (a program of a module, for example) |
core.disk_budget_gib |
how much room on the disk the platform may take in all; 0 — no limit; acts without a restart |
core.disk_free_min_gib |
how much room on the disk the platform leaves free whatever the limit; acts without a restart |
core.backups_dir |
where backups are put; empty — backups in the folder of the installation; acts without a restart |
core.backups_keep |
how many of the last backups to keep |
core.event_ring_size |
how many latest events the kernel remembers |
core.command_dedup |
how many commands the kernel remembers to recognise a repeated delivery |
The kernel reads its keys at its start, so they take effect after the platform is restarted; the two keys of the room the kernel reads again at every question about the room, and they take effect at once.
The workshop — functions/ui/settings.schema.json:
Table 5 — Settings keys of the workshop
| Key | Purpose |
|---|---|
ui.scheme |
the colour scheme: dark or light; the colours the person did not set follow it |
ui.notice.show_s |
how many seconds a notice about a question of a program or a failure stays on the screen |
ui.notice.at_once |
how many notices are seen at the same time |
ui.undo_depth |
how many of the latest edits of a program «Undo» takes back |
ui.open_dir |
the folder of Windows the dialog to choose a file opens at; empty — the one Windows chooses |
ui.keep_awake |
keep Windows from sleeping while a run of any program goes on |
ui.autostart |
start the platform at the sign-in to Windows: a shortcut among the programs Windows starts |
ui.window.exe |
the window program, a path in WSL; empty — bin/ogas-window.exe, then the result of make window |
ui.window.port |
the port of the window on 127.0.0.1; 0 — a free one for each start |
ui.window.devtools_port |
the WebView2 debugging port, for development only; 0 — off |
ui.font.source |
the source of the font: built in, a Windows system font, or a file |
ui.font.file |
the path in WSL to the font file, if the source is a file |
ui.font.size_* |
the sizes of letters: main, title, subtitle, small, bar labels, node |
ui.radius.* |
roundings: the window, the buttons of the platform window, a field, an action button, a node, a list row |
ui.space.* |
the margin of a list, the gap between rows, the height of a row |
ui.stroke.* |
the width of outlines: the window, a field, a node, a link of the graph |
ui.layout.* |
the cell of a bar, the buttons of the operating system window, the column on the left and the panel of the chosen at windows on the host, the size of a node |
ui.color.* |
the colours of the shell: the host, the bars, the windows (column on the left, work area, panel of the chosen), dialogs, rows and fields, buttons, the graph, the pulpit, outlines; the heads of nodes by the family of their kind and the head of a group (ui.color.head_*), links and port points by data type (ui.color.type_*) — The workshop, 5.3 |
Language — functions/i18n/settings.schema.json:
Table 6 — Settings keys of the language
| Key | Purpose |
|---|---|
i18n.language |
the language of the interface |
The graph — functions/graph/settings.schema.json:
Table 7 — Settings keys of the function of the graph
| Key | Purpose |
|---|---|
graph.max_iterations |
the largest number of rounds of one loop |
graph.max_loop_ms |
the longest time of one loop from the first entry into its body; a node may set less |
graph.queue_depth |
how many pieces of data may wait at one input of a node |
graph.runs_keep |
how many latest runs of a process to keep; 0 — do not clear by itself |
graph.show_max_bytes |
how many bytes of data one «Show» node keeps and gives the window; of more, the beginning is kept |
graph.file_max_bytes |
the largest file the person can give a process; 1 GiB by default (File formats, 16.4) |
graph.timer_min_ms |
the smallest interval between firings of a timer event |
Modules — functions/modules/settings.schema.json:
Table 8 — Settings keys of the function of modules
| Key | Purpose |
|---|---|
modules.artifact_max_bytes |
the largest size of one result file of a step |
modules.gpu_budget_mb |
how much video memory the modules that are up share; 0 — the video card is used by one |
modules.models_dir |
the folder of networks: a path from the installation folder, models by default, or a full path as WSL or Windows writes it (Modules, section 11) |
modules.ping_interval_ms |
how often to ask long modules and services that are up whether they answer (ping) |
modules.ping_timeout_ms |
how long to wait for the answer to ping; a module that did not answer is stopped as lost |
modules.python_candidates |
which Python programs to try, in order |
modules.stderr_tail_bytes |
how many bytes of the end of the service output of a module to keep and show when a step is refused |
modules.uv |
the uv program the Python environments of processes are installed with: a name or a path |
modules.parallel_max |
how many modules on the whole computer do a step at the same time; 0 — no limit |
modules.memory_max_mb |
how much memory all modules together may take; 0 — no limit |
modules.cpu_max |
how many processor cores all modules together may take; 0 — no limit |
How long to wait for a module to stop is set by core.process_stop_grace_ms: stopping an OS process is the kernel's business, and there is no second key about the same.
The pulpit — functions/canvas/settings.schema.json, the section of the settings window «Interface of the platform»:
Table 9 — Settings keys of the function of the pulpit
| Key | Purpose |
|---|---|
canvas.image_max_bytes |
the largest size of a picture of the pulpit; a larger picture is not taken into the pulpit and not given to the window. The upper limit of the key is what passes as one message of the exchange |
canvas.sheet_gap |
the gap between elements the function of the pulpit leaves when it gives a new element a place itself |
canvas.sheet_height |
the height of the sheet of a new pulpit and a new section, in units of the sheet |
canvas.sheet_margin |
the margin from the edge of the sheet the function of the pulpit leaves when it gives a place itself; an element being carried sticks to the same line |
canvas.sheet_scale_min |
how far the sheet on the screen may be made smaller, in percent of its full size; the sheet gets no smaller, and the area scrolls |
canvas.sheet_step |
the step of the sheet: an element being carried or pulled by its edge snaps to it, and by it the function of the pulpit looks for a place for a new element |
canvas.sheet_width |
the width of the sheet of a new pulpit and a new section, in units of the sheet |
canvas.theme_accent |
the colour of action: an event button, the fill of a bar, a switch that is on |
canvas.theme_background |
the background of the pulpit: the colour of the sheet and the area around it |
canvas.theme_font |
the font of the pulpit: the font of the platform, a Windows font, serif or monospaced |
canvas.theme_letters |
the height of letters on the pulpit, in units of the sheet |
canvas.theme_ok |
the colour of done: the indicator of a run that went through, the retry button |
canvas.theme_radius |
the rounding of corners on the pulpit, in units of the sheet |
canvas.theme_stop |
the colour of stopping: the stop button, a failure, the mark of an element that does not work |
canvas.theme_surface |
the colour of elements: fields, values, frames |
canvas.theme_text |
the colour of letters |
The numbers of the sheet take effect from the next change of the pulpit; sheets that already exist do not change by them. A process may have its own numbers at the level of the settings of the process (The workshop, 6.3).
The keys canvas.theme_* are the look of a pulpit that did not set its own: a pulpit names in its document only the theme keys it set itself, the rest are taken from here (The workshop, 6.5). The section of the schema canvas.theme is at once the closed list of theme keys and the description of what each takes: the document of the pulpit is checked by it as well (File formats, section 7).
The journal — functions/observe/settings.schema.json:
Table 10 — Settings keys of the function of observation
| Key | Purpose |
|---|---|
observe.logs_keep_months |
how many latest months of the common journal to keep, the current one among them; 0 — keep everything (The make-up of the platform, 3.8.2) |
Sources — functions/sources/settings.schema.json (The workshop, 5.6):
Table 11 — Settings keys of the function of sources
| Key | Purpose |
|---|---|
sources.ogas_url |
the address of the O.G.A.S. showcase, https://ogas.space/catalog.json by default; empty — there is no showcase in the library |
sources.catalogs |
the addresses of other showcases of the same format — each has its own row under «Sources» |
sources.huggingface_url |
the address of Hugging Face or its mirror; empty — there is no such source |
sources.civitai_url |
the address of Civitai; empty — there is no such source |
sources.check_on_start |
whether to look at the showcase of ogas.space at start — for a new version of the platform: on (by default) or off — only by the button «Check» |
sources.results |
how many things one search shows |
sources.answer_s |
how long to wait for a source to answer a search and a question about files |
sources.stall_s |
how many seconds a download may stand without a single byte before it is cut off |
sources.max_gib |
the largest download, GiB: a larger one does not begin |
The door for programs — functions/gate/settings.schema.json (Methods of the platform services, section 5):
Table 12 — Settings keys of the function of the door
| Key | Purpose |
|---|---|
gate.door |
whether the door for the person's programs is open: closed or open |
gate.port |
the port of the door on 127.0.0.1; 0 — a free one, named by data/gate.json |
gate.clients |
how many programs may come in at once |
The assistant — functions/assistant/settings.schema.json (Methods of the platform services, section 6):
Table 13 — Settings keys of the function of the assistant
| Key | Purpose |
|---|---|
assistant.max_steps |
how many calls of the network per task before the assistant stops and asks |
assistant.task_budget |
how many tokens per task before the assistant stops and asks |
assistant.answer_length |
how many tokens the network may write in one answer |
assistant.result_chars |
how many characters of the result of one action of the assistant the network reads |
The profile — functions/profile/settings.schema.json (Methods of the platform services, section 7):
Table 14 — Settings keys of the function of the profile
| Key | Purpose |
|---|---|
profile.ask_at_start |
whether to offer at start to make a profile or sign in with one's own: on (by default) or off — «Later» sets it so |
profile.check_on_start |
whether to look at start at what became of one's sendings, and at letters: on (by default) or off — only by the button «Check» |
profile.site |
the address of the site of the platform, https://ogas.space/ by default |
profile.answer_s |
how long to wait for the site to answer a reading |
profile.send_s |
how long one sending may go |