Error: accepts 1 arg(s), received 2 is the Ollama command line counting the
words after the command and finding more model names than that command takes. Give
pull, show, create or stop one model
name, and run the command once per model when you have several.
The fix is to drop the extra word or loop over the names: ollama pull qwen2.5:0.5b,
then ollama pull all-minilm. The same message with other numbers
(accepts 2 arg(s), received 1) means a word is missing.
The error
PS> ollama pull qwen2.5:0.5b all-minilm
Error: accepts 1 arg(s), received 2
PS> ollama show qwen2.5:0.5b all-minilm
Error: accepts 1 arg(s), received 2
PS> ollama create mymodel -f Modelfile extra
Error: accepts 1 arg(s), received 2
PS> ollama stop qwen2.5:0.5b all-minilm
Error: accepts 1 arg(s), received 2
PS> ollama cp tutor
Error: accepts 2 arg(s), received 1
PS> ollama pull
Error: accepts 1 arg(s), received 0
Why it happens
Each Ollama subcommand declares how many plain arguments it takes. pull,
show, create and stop took exactly one in the test,
cp took exactly two (source and destination), and the client refused anything
else. It did not need the server for that: with OLLAMA_HOST pointed at a
port where nothing listened, ollama pull qwen2.5:0.5b all-minilm printed the
same message. Flags such as -f Modelfile are not
counted, so in the create line the stray word extra is the second
argument. Every refused command returned exit code 1.
Listing several models in one ollama pull, the way
apt-get install a b c takes several packages, is one way to meet it. Not
every command is strict: ollama rm tutor2 tutor3 deleted both
models in the same session.
The fix
PS> ollama show qwen2.5:0.5b
Model
architecture qwen2
parameters 494.03M
...
PS> foreach ($m in 'qwen2.5:0.5b','all-minilm') { ollama pull $m }
...
success
...
success
PS> ollama rm tutor2 tutor3
deleted 'tutor2'
deleted 'tutor3'
One name per call worked for show, pull, create,
run and stop, and two names for cp
(ollama cp tutor4 tutor5 printed copied 'tutor4' to 'tutor5'). In PowerShell a
foreach loop pulls a list, as above. For
cp, pass both the source and the new name. If the extra word was meant as a
prompt, that belongs to ollama run, which takes the model name and then the
prompt text: ollama run tutor5 "Say hi in three words" answered
Hi there!.
How it was reproduced
On Windows 11 in Windows PowerShell 5.1 with Ollama 0.40.16, against a separate test
server started with OLLAMA_HOST=127.0.0.1:15190 and its own models folder
holding qwen2.5:0.5b, all-minilm and two copies named tutor2 and tutor3. Each wrong
command was run once and its output and exit code were saved; then the single-name
forms, the pull loop and the two-name rm were run against the same server.
Frequently asked
- How do I pull several Ollama models at once?
- ollama pull takes one model name. Run it once per model, for example in a PowerShell foreach loop or a bash for loop over the names.
- What does 'accepts 2 arg(s), received 1' mean in Ollama?
- The command needs two plain arguments and got one. ollama cp is the example: it needs the source model and the new name.
- Does ollama rm accept more than one model?
- In the test with Ollama 0.40.16, ollama rm tutor2 tutor3 deleted both models, unlike pull, show, create and stop, which refused a second name.
More decoded errors in the Fixes category. For a model name that Ollama refuses for its spelling rather than its count, see Ollama: 'invalid model name'.