> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-typedoc-upgrade.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# startLLM

> TypeScript SDK reference

> **startLLM**(`opts`): [`LLM`](../interfaces/llm)

Defined in: [src/genai/api.ts:77](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/genai/api.ts#L77)

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

## Parameters

### opts

[`LLMInit`](../interfaces/llminit)

## Returns

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

## Examples

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

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