ollama._types.ResponseError: model 'llama2' not found #82

Closed
opened 2026-02-15 16:27:55 -05:00 by yindo · 2 comments
Owner

Originally created by @nahidalam on GitHub (May 7, 2024).

I tried testing this basic script below but it throws error that model llama2 is not found

import ollama
response = ollama.chat(model='llama2', messages=[
  {
    'role': 'user',
    'content': 'Why is the sky blue?',
  },
])
print(response['message']['content'])
    raise ResponseError(e.response.text, e.response.status_code) from None
ollama._types.ResponseError: model 'llama2' not found, try pulling it first

If I do model='llama3', it works fine

Originally created by @nahidalam on GitHub (May 7, 2024). I tried testing this basic script below but it throws error that model llama2 is not found ``` import ollama response = ollama.chat(model='llama2', messages=[ { 'role': 'user', 'content': 'Why is the sky blue?', }, ]) print(response['message']['content']) ``` ``` raise ResponseError(e.response.text, e.response.status_code) from None ollama._types.ResponseError: model 'llama2' not found, try pulling it first ``` If I do `model='llama3'`, it works fine
yindo closed this issue 2026-02-15 16:27:55 -05:00
Author
Owner

@n-vent commented on GitHub (May 8, 2024):

Try to pull the llama2 model first from the ollama library:

In the shell:

ollama pull llama2

Or in Python:

import ollama
ollama.pull('llama2')

@n-vent commented on GitHub (May 8, 2024): Try to pull the llama2 model first from the ollama library: In the shell: ``` ollama pull llama2 ``` Or in Python: ```python import ollama ollama.pull('llama2') ```
Author
Owner

@immmor commented on GitHub (Jan 2, 2025):

Got the same error. Have you fixed?

@immmor commented on GitHub (Jan 2, 2025): Got the same error. Have you fixed?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#82