alibaba/page-agent · warning

[PageAgent] LLMConfig.temperature is deprecated and will be

Error message

[PageAgent] LLMConfig.temperature is deprecated and will be removed in a future version. Use transformRequestBody to set it only for models you have verified accept it.

What it means

This is a deprecation console.warn from parseLLMConfig: setting LLMConfig.temperature is deprecated because many OpenAI-compatible providers reject or mishandle the temperature field, causing hard-to-diagnose 4xx errors. The library wants temperature set selectively via transformRequestBody only for models verified to accept it. It is informational, not a thrown error.

Source

Thrown at packages/llms/src/index.ts:93

			console.debug('[LLM] retryable failure, will retry:', error)
			settings.onRetry(attempt, error as Error)

			await new Promise((resolve) => setTimeout(resolve, 100))
		}
	}
}

export function parseLLMConfig(config: LLMConfig): ResolvedLLMConfig {
	// Runtime validation as defensive programming (types already guarantee these)
	if (!config.baseURL || !config.model) {
		throw new Error(
			'[PageAgent] LLM configuration required. Please provide: baseURL, model. ' +
				'See: https://alibaba.github.io/page-agent/docs/features/models'
		)
	}

	if (config.temperature !== undefined) {
		console.warn(
			'[PageAgent] LLMConfig.temperature is deprecated and will be removed in a future version. ' +
				'Use transformRequestBody to set it only for models you have verified accept it.'
		)
	}

	return {
		baseURL: config.baseURL,
		model: config.model,
		apiKey: config.apiKey || '',
		temperature: config.temperature,
		maxRetries: config.maxRetries ?? 2,
		transformRequestBody: config.transformRequestBody ?? ((requestBody) => requestBody),
		disableNamedToolChoice: config.disableNamedToolChoice ?? false,
		customFetch: (config.customFetch ?? fetch).bind(globalThis), // fetch will be illegal unless bound
	}
}

View on GitHub (pinned to d02db1ee7c)

Solutions

  1. Remove temperature from LLMConfig and set it per-model via transformRequestBody: (body) => ({ ...body, temperature: 0 })
  2. If you need temperature for all requests, centralize it in one transformRequestBody helper
  3. Audit for provider compatibility: only set temperature where the endpoint accepts it
  4. Ignore the warning only if temporary, but plan migration before removal

Example fix

// before
const llm = new LLM({ baseURL, model, apiKey, temperature: 0 })

// after
const llm = new LLM({
  baseURL, model, apiKey,
  transformRequestBody: (body) => ({ ...body, temperature: 0 }),
})
Defensive patterns

Strategy: validation

Validate before calling

if ('temperature' in config) delete config.temperature // and move it to transformRequestBody before constructing LLM

Prevention

When it happens

Trigger: Constructing LLM or PageAgent with a config object containing temperature (even temperature: undefined is fine, but any explicit value warns); migrating older configs where temperature was a normal field; provider endpoints that 400 on temperature (some reasoning models).

Common situations: Upgrading @page-agent/llms to a version where temperature was deprecated; users of gateways/proxies that reject temperature for certain models; copy-pasted configs from older examples.

Related errors


AI-assisted analysis of alibaba/page-agent@d02db1ee7c (2026-08-28). Data as JSON: /api/errors/f2b86aac041402cf. Report an issue: GitHub.