Bentrix Docs
HomePricingDashboard

Julia: model

Every method of client.model in the Julia SDK.

check#

Check an ONNX model's folder · tool model_check

scope: readplan: freesince 3.4.0

Nothing is started.

Declaration

client.model
check(file)

Parameters

NameTypeWhat it is
fileanyrequiredAn ONNX model's folder in the models folder.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.model.check("…")

forget#

Forget a model an agent installed · tool model_forget

scope: adminplan: freesince 3.6.0

Removes a model an agent installed from the models folder - its files and its record. A model the person put there is the person's own to delete, and is refused here.

Declaration

client.model
forget(name)

Parameters

NameTypeWhat it is
nameanyrequiredA model's name in the models folder.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.model.forget("…")

infer#

Run a policy once · tool model_infer

scope: labplan: freesince 3.6.0

Runs an ONNX model of the models folder on one input - the Gym's policy run by Bentrix (engine "bentrix") instead of the program's own runtime - consent checked, on the engine the person chose and in its host, the host kept for the next call. Answers its output values and how long it took.

Declaration

client.model
infer(name, input)

Parameters

NameTypeWhat it is
nameanyrequiredAn ONNX policy's folder in the models folder: model.onnx, no manifest needed.
inputanyrequiredThe flattened observation: the model's one input, [1, n] of 32-bit floats.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers its output values and how long it took.

Example

client.model.infer("…", "…")

info#

One model in the models folder · tool model_info

scope: readplan: freesince 3.6.0

Declaration

client.model
info(name)

Parameters

NameTypeWhat it is
nameanyrequiredA model's name in the models folder.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.model.info("…")

install#

Install a model into the models folder · tool model_install

scope: adminplan: freesince 3.6.0

Writes a model into the person's models folder - an ONNX model (onnx_base64 with its manifest) or a Python model (python, its source) - where it waits for the person's tick on these exact bytes (Settings > Forecast > Models, Run it) before anything runs it; a model replaced since it was ticked waits again. A name the person's own file holds is never overwritten. Answers the model as model_list does, its consent waiting_for_the_tick.

Declaration

client.model
install(name; manifest = nothing, onnx_base64 = nothing, python = nothing)

Parameters

NameTypeWhat it is
nameanyrequiredThe model's name in the models folder: a folder for an ONNX model, a.py name for a Python one.
manifestanyoptionalIts manifest (model_manifest), with the ONNX file.
onnx_base64anyoptionalAn ONNX model's file, base64.
pythonanyoptionalA Python model's source, declaring one @bentrix.model.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers the model as model_list does, its consent waiting_for_the_tick.

Example

client.model.install("…")

list#

The models in the models folder · tool model_list

scope: readplan: freesince 3.6.0

Every model in the person's models folder: its name, kind (onnx or python), the label its forecasts carry where the manifest says it, its hash, its consent (own - the person's file, no tick needed; waiting_for_the_tick - installed by an agent; ticked), the engine it would run on, and the ids it runs under now. Never where an engine's library is.

Declaration

client.model
list()

It takes no arguments.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.model.list()

pause#

Pause or resume a model · tool model_pause

scope: labplan: freesince 3.4.0

Pauses a running model (it is asked nothing at the closes while paused; its last forecast stays) or resumes it (paused false), as the legend row's Pause does. Answers its state.

Declaration

client.model
pause(model; paused = nothing)

Parameters

NameTypeWhat it is
modelanyrequired
pausedanyoptionalFor model_pause: true pauses, false resumes.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers its state.

Example

client.model.pause(1)

run_once#

Run a model once at a close · tool model_run_once

scope: labplan: freesince 3.6.0

Runs a model of the models folder once - consent checked, on the engine the person chose, in a process of its own unless the person keeps the built-in engine inside Bentrix - on the window cut at the last close of its interval at or before at_ms (the workbench's clock when omitted), and puts what it answers as its forecast - or, for a model whose manifest declares outputs (schema 2), each output as output_put puts it - authored model:<name>, stamped with the workbench's clock when it lands. The frame waits for it at most the Time cap per run. Answers the forecast's state (or the outputs put), the anchor, how long the model took and whether that was late.

Declaration

client.model
run_once(name, bench, symbol; at_ms = nothing)

Parameters

NameTypeWhat it is
nameanyrequiredA model's name in the models folder.
benchanyrequired
symbolanyrequiredThe market it forecasts, one of the workbench's.
at_msanyoptionalA moment at or before the workbench's clock: the model runs at the last close of its interval by then. Omitted, the clock.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers the forecast's state (or the outputs put), the anchor, how long the model took and whether that was late.

Example

client.model.run_once("…", bench, "SYN-DOCS")

start#

Run a model file on a workbench · tool model_start

scope: labplan: freesince 3.4.0

Starts a model from the person's models folder - a Python file declaring one @bentrix.model, run by the person's own interpreter, or an ONNX model's folder (model_manifest), run by Bentrix's built-in engine - in a process of its own, on a workbench's market: at each close of its interval it is handed the window cut there, and what it answers is put on the chart as its forecast, stamped with the instant it came back (a slow model's forecast arrives late, as a live program's does). Only a file in the models folder starts; its process carries no Bentrix variable. Answers the model's id and state.

Declaration

client.model
start(bench, symbol, file)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench whose closes the model runs at.
symbolanyrequiredThe market it forecasts, one of the workbench's.
fileanyrequiredA name in the models folder: a.py declaring one @bentrix.model, or an ONNX model's folder (model.onnx beside its manifest.json, model_manifest).

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers the model's id and state.

Example

client.model.start(bench, "SYN-DOCS", "…")

stop#

Stop a model · tool model_stop

scope: labplan: freesince 3.4.0

Ends a model's process; its forecasts already put stay on the workbench until cleared.

Declaration

client.model
stop(model; paused = nothing)

Parameters

NameTypeWhat it is
modelanyrequired
pausedanyoptionalFor model_pause: true pauses, false resumes.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.model.stop(1)

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed