diff --git a/tasks/workstation/linux/software/llm.yml b/tasks/workstation/linux/software/llm.yml index 41c68cf..b76573c 100644 --- a/tasks/workstation/linux/software/llm.yml +++ b/tasks/workstation/linux/software/llm.yml @@ -904,6 +904,23 @@ } alias ollama-sizes="ollama_sizes " alias model-sizes="ollama_sizes " + + function ollama_threads() { + model="$1" + if [[ -z $model ]]; then + model="qwen3.5:4b" + fi + # Benchmark Thread Count + for t in {1..{{ ansible_processor_vcpus }}}; do + echo "`date` - $t Threads`" + curl -s http://localhost:11434/api/generate \ + -d '{"model":"$model","prompt":"Hello","stream":false,"options":{"num_thread":$t}}' \ + | jq .eval_count / .eval_duration + done + } + alias ollama-threads="ollama_threads " + alias ollama-cpus="ollama_threads " + alias ollama-cpu="ollama_threads " state: present create: false backup: true