> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# startLLM

> TypeScript SDK reference

# startLLM

▸ **startLLM**(`opts`): [`LLM`](../classes/llm)

Start an LLM span as a child of the current Turn. Throws if no Turn is
active.

#### Parameters

| Name   | Type                               |
| :----- | :--------------------------------- |
| `opts` | [`LLMInit`](../interfaces/llminit) |

#### Returns

[`LLM`](../classes/llm)

`Example`

```ts twoslash theme={null}
// @noErrors
weave.startLLM({model: 'gpt-4o-mini', providerName: 'openai'});
```

`Example`

```ts twoslash theme={null}
// @noErrors
weave.startLLM({
  model: 'gpt-4o-mini',
  providerName: 'openai',
  startTime: new Date('2026-05-29T10:00:00.000Z'),
});
```

#### Defined in

[src/genai/api.ts:70](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/genai/api.ts#L70)

***
