Skip to content

Add min_p parameter to Options interface#265

Merged
BruceMacD merged 1 commit intoollama:mainfrom
jagreehal:add-min-p-parameter
Dec 13, 2025
Merged

Add min_p parameter to Options interface#265
BruceMacD merged 1 commit intoollama:mainfrom
jagreehal:add-min-p-parameter

Conversation

@jagreehal
Copy link
Contributor

Adds the min_p (minimum probability threshold) parameter to the Options interface. This parameter is supported by the Ollama API but was missing from the TypeScript definitions.

min_p works alongside top_p to control token selection during generation by setting a minimum probability threshold relative to the most likely token. Tokens with probabilities below this threshold are filtered out.

This addresses the missing parameter mentioned in issue #145.

Changes:

  • Added min_p: number to the Options interface in src/interfaces.ts
  • Positioned after top_p since they are related sampling parameters

Adds the min_p (minimum probability threshold) parameter to the Options
interface. This parameter is supported by the Ollama API but was missing
from the TypeScript definitions.

min_p works alongside top_p to control token selection during generation
by setting a minimum probability threshold relative to the most likely token.
Tokens with probabilities below this threshold are filtered out.

This addresses the missing parameter mentioned in issue ollama#145.
Copy link
Member

@BruceMacD BruceMacD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this got missed. Thanks!

@BruceMacD BruceMacD merged commit 133f362 into ollama:main Dec 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants