Loading...
const res = await llm.generate({
prompt: extractInvoiceFieldsPrompt,
temperature: 1.2,
});const res = await llm.generate({
prompt: extractInvoiceFieldsPrompt,
temperature: 0,
});Extraction needs the most likely tokens, so a low temperature gives steadier fields; keep higher values for creative text.
A low value near '0' suits code, extraction and classification. Higher values give more varied text for brainstorming or creative writing.
Not fully. It favors the most likely token, but batching and hardware effects can still change the output between runs.
Usually change one and leave the other at its default. Both reshape the same token distribution, so tuning both makes behavior hard to predict.