Skip to main content

modules

@hotg-ai/forge / Exports

@hotg-ai/forge

Table of contents​

Classes​

Type aliases​

Functions​

Type aliases​

Evaluate​

Ƭ Evaluate: (inputs: Inputs | ReadInput) => OutputValue[]

Type declaration​

â–¸ (inputs): OutputValue[]

Parameters​
NameType
inputsInputs | ReadInput
Returns​

OutputValue[]


ForgeHook​

Ƭ ForgeHook: NotLoaded | Loading | LoadingFailed | Loaded

The current state of the Forge hook.


Inputs​

Ƭ Inputs: Object

A convenience type that can be used when all inputs are known ahead of time and you want things to "Just Work" out of the box.

Type declaration​

NameType
audio?AudioBuffer[]
floatImage?HTMLImageElement[]
image?HTMLImageElement[]
text?string[]

OutputValue​

Ƭ OutputValue: Object

A tensor value generated by the SERIAL output.

Type declaration​

NameTypeDescription
channelnumberAn integer specifying which SERIAL output this is attached to.
dimensionsnumber[]The tensor's dimensions.
elementsstring[] | number[]The elements in this tensor, flattened into a single array in row-major order.
type_namestringThe Rust name for this tensor's element type.

Parameters​

Ƭ Parameters: Object

Type declaration​

NameTypeDescription
apiKeystringAn API key used to authenticate with the Forge backend.
backend?"forge" | "enterprise"Choose which backend to fetch Runes from. If not provided, defaults to Forge.
baseURL?stringOverride the base URL used for the interacting with the backend. This is normally only used when using the enterprise backend, routing requests through a proxy, or developing Forge itself.
deploymentIdnumberThe identifier of the Rune being deployed.
telemetry?Partial<TelemetryConfig> | nullConfiguration for the telemetry system. The default config is used if this field is undefined. If an object is provided, any fields that are set will override the corresponding field from the default config. Set to null to opt out of telemetry.

Functions​

default​

â–¸ default(parameters, signal?): Promise<Evaluate>

Load a Rune from the Forge backend.

Parameters​

NameTypeDescription
parametersParametersarguments used to specify how a Rune is loaded from the Forge backend.
signal?AbortSignala signal that can be used to abort a pending download.

Returns​

Promise<Evaluate>

Prediction of the values and inference


registerBackend​

â–¸ registerBackend(backend): void

Register an inference backend for a particular model type.

Parameters​

NameTypeDescription
backendModelBackendthe backend to register.

Returns​

void


useForge​

â–¸ useForge(params?): ForgeHook

A React hook which will try to load a Rune from Forge in the background.

Parameters​

NameTypeDescription
params?Parametersparameters used for loading the Rune.

Returns​

ForgeHook

the loaded Rune, or an object representing the state