numThread method

OllamaBuilder numThread(
  1. int threads
)

Sets the number of threads to use for computation

Controls the number of CPU threads used for inference. More threads can improve performance on multi-core systems.

  • Default: Number of CPU cores
  • Range: 1 to number of available CPU cores
  • Higher values: Better CPU utilization, more CPU usage
  • Lower values: Less CPU usage, potentially slower inference

Implementation

OllamaBuilder numThread(int threads) {
  _baseBuilder.extension('numThread', threads);
  return this;
}