# InferenceSession | ONNX Runtime JavaScript API
Documentation for ONNX Runtime JavaScript API

# Interface InferenceSession

Represent a runtime instance of an ONNX model.

#### Hierarchy

- InferenceSession

- Defined in inference-session.ts:9
- Defined in inference-session.ts:269
- Defined in inference-session.ts:380

#####
Index

### Properties

inputNames
outputNames

### Methods

endProfiling
run
startProfiling

## Properties

### `Readonly` inputNames

inputNames: readonly string[]

Get input names of the loaded model.

- Defined in inference-session.ts:314

### `Readonly` outputNames

outputNames: readonly string[]

Get output names of the loaded model.

- Defined in inference-session.ts:319

## Methods

### endProfiling

- endProfiling(): void

- End profiling.

  #### Returns void

  - Defined in inference-session.ts:305

### run

- run(feeds: OnnxValueMapType, options?: RunOptions ): Promise< OnnxValueMapType >

- Execute the model asynchronously with the given feeds and options.

  ### Returns

  A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.

  #### Parameters

  - ##### feeds: OnnxValueMapType

    Representation of the model input. See type description of `InferenceSession.InputType` for detail.

  - ##### `Optional` options: RunOptions

    Optional. A set of options that controls the behavior of model inference.

  #### Returns Promise< OnnxValueMapType >

  - Defined in inference-session.ts:279
- run(feeds: OnnxValueMapType, fetches: FetchesType, options?: RunOptions ): Promise< OnnxValueMapType >

- Execute the model asynchronously with the given feeds, fetches and options.

  ### Returns

  A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.

  #### Parameters

  - ##### feeds: OnnxValueMapType

    Representation of the model input. See type description of `InferenceSession.InputType` for detail.

  - ##### fetches: FetchesType

    Representation of the model output. See type description of `InferenceSession.OutputType` for detail.

  - ##### `Optional` options: RunOptions

    Optional. A set of options that controls the behavior of model inference.

  #### Returns Promise< OnnxValueMapType >

  - Defined in inference-session.ts:290

### startProfiling

- startProfiling(): void

- Start profiling.

  #### Returns void

  - Defined in inference-session.ts:300

Generated using TypeDoc