Bentrix Docs
HomePricingDashboard

Go: model

Every method of client.Model in the Go SDK.

Check#

Check an ONNX model's folder · tool model_check

scope: readplan: freesince 3.4.0

Nothing is started.

Declaration

client.Model
func (a *ModelAPI) Check(ctx context.Context, args ModelCheckArgs) (any, error)

Parameters

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

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

What the tool's description says.

Example

client.Model.Check(ctx, mcp.ModelCheckArgs{File: "…"})

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
func (a *ModelAPI) Forget(ctx context.Context, args ModelForgetArgs) (any, error)

Parameters

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

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

What the tool's description says.

Example

client.Model.Forget(ctx, mcp.ModelForgetArgs{Name: "…"})

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
func (a *ModelAPI) Infer(ctx context.Context, args ModelInferArgs) (any, error)

Parameters

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

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

Answers its output values and how long it took.

Example

client.Model.Infer(ctx, mcp.ModelInferArgs{Name: "…", Input: "…"})

Info#

One model in the models folder · tool model_info

scope: readplan: freesince 3.6.0

Declaration

client.Model
func (a *ModelAPI) Info(ctx context.Context, args ModelInfoArgs) (any, error)

Parameters

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

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

What the tool's description says.

Example

client.Model.Info(ctx, mcp.ModelInfoArgs{Name: "…"})

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
func (a *ModelAPI) Install(ctx context.Context, args ModelInstallArgs) (any, error)

Parameters

NameTypeWhat it is
NamestringrequiredThe 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.
OnnxBase64*stringoptionalAn ONNX model's file, base64.
Python*stringoptionalA Python model's source, declaring one @bentrix.model.

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

Answers the model as model_list does, its consent waiting_for_the_tick.

Example

client.Model.Install(ctx, mcp.ModelInstallArgs{Name: "…"})

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
func (a *ModelAPI) List(ctx context.Context) (any, error)

It takes no arguments.

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

What the tool's description says.

Example

client.Model.List(ctx)

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
func (a *ModelAPI) Pause(ctx context.Context, args ModelPauseArgs) (any, error)

Parameters

NameTypeWhat it is
Modelint64required
Paused*booloptionalFor model_pause: true pauses, false resumes.

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

Answers its state.

Example

client.Model.Pause(ctx, mcp.ModelPauseArgs{Model: 1})

RunOnce#

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
func (a *ModelAPI) RunOnce(ctx context.Context, args ModelRunOnceArgs) (any, error)

Parameters

NameTypeWhat it is
NamestringrequiredA model's name in the models folder.
Benchstringrequired
SymbolstringrequiredThe market it forecasts, one of the workbench's.
AtMs*int64optionalA moment at or before the workbench's clock: the model runs at the last close of its interval by then. Omitted, the clock.

Returns

(any, error) — the tool’s answer as maps and slices (any).

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.RunOnce(ctx, mcp.ModelRunOnceArgs{Name: "…", Bench: bench, Symbol: "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
func (a *ModelAPI) Start(ctx context.Context, args ModelStartArgs) (any, error)

Parameters

NameTypeWhat it is
BenchstringrequiredThe workbench whose closes the model runs at.
SymbolstringrequiredThe market it forecasts, one of the workbench's.
FilestringrequiredA 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

(any, error) — the tool’s answer as maps and slices (any).

What it answers

Answers the model's id and state.

Example

client.Model.Start(ctx, mcp.ModelStartArgs{Bench: bench, Symbol: "SYN-DOCS", File: "…"})

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
func (a *ModelAPI) Stop(ctx context.Context, args ModelStopArgs) (any, error)

Parameters

NameTypeWhat it is
Modelint64required
Paused*booloptionalFor model_pause: true pauses, false resumes.

Returns

(any, error) — the tool’s answer as maps and slices (any).

What it answers

What the tool's description says.

Example

client.Model.Stop(ctx, mcp.ModelStopArgs{Model: 1})

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