Skip to content

Instantly share code, notes, and snippets.

@saravanabalagi
Created August 27, 2025 18:43
Show Gist options
  • Select an option

  • Save saravanabalagi/eafb4156748be2c20d5c84963752ed1e to your computer and use it in GitHub Desktop.

Select an option

Save saravanabalagi/eafb4156748be2c20d5c84963752ed1e to your computer and use it in GitHub Desktop.
Pull multiple ollama models
import os
models = {
"all-minilm": ["l6-v2"],
"deepseek-r1": ["1.5b", "7b", "8b", "14b", "32b", "70b"],
"devstral": ["24b"],
"gemma3": ["1b-it-qat", "4b-it-qat", "12b-it-qat", "27b-it-qat", "1b", "4b", "12b", "27b"],
"llama3.2": ["1b", "3b"],
"llama3.3": ["70b"],
"mistral-small3.1": ["24b"],
"nomic-embed-text": ["latest"],
"phi": ["14b"],
"qwen2.5-coder": ["0.5b", "1.5b", "3b", "7b", "14b", "32b"],
"qwen3": ["0.6", "1.7b", "4b", "7b", "8b", "14b", "32b"],
"qwq": ["32b"],
}
ollama_pull_cmd = 'ollama pull'
for model, variants in models.items():
print(f'Pulling {model} variants: {", ".join(variants)}')
for variant in variants:
cmd = f'{ollama_pull_cmd} {model}:{variant}'
print(f'Pulling {model}:{variant}')
return_code = os.system(cmd)
if return_code != 0:
print(f'Error pulling {variant} variant of {model}.')
else:
print(f'Successfully pulled {variant} variant of {model}.')
print(f'Finished pulling {model} models.')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment