PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. #265

Open
opened 2026-02-15 16:29:21 -05:00 by yindo · 6 comments
Owner

Originally created by @khteh on GitHub (Apr 23, 2025).

Originally assigned to: @ParthSareen on GitHub.

My terminal is innundated with these warnings:

/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:81: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
  if key in self.model_fields:
/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:82: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
  return self.model_fields[key].default is not None
/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:81: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
  if key in self.model_fields:
/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:82: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
  return self.model_fields[key].default is not None
/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:81: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
  if key in self.model_fields:
/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:82: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
  return self.model_fields[key].default is not None
Originally created by @khteh on GitHub (Apr 23, 2025). Originally assigned to: @ParthSareen on GitHub. My terminal is innundated with these warnings: ``` /home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:81: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0. if key in self.model_fields: /home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:82: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0. return self.model_fields[key].default is not None /home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:81: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0. if key in self.model_fields: /home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:82: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0. return self.model_fields[key].default is not None /home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:81: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0. if key in self.model_fields: /home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/ollama/_types.py:82: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0. return self.model_fields[key].default is not None ```
Author
Owner

@khteh commented on GitHub (Apr 24, 2025):

How do I filter out this warning from being logged?

@khteh commented on GitHub (Apr 24, 2025): How do I filter out this warning from being logged?
Author
Owner

@ParthSareen commented on GitHub (Apr 24, 2025):

Hey @khteh will check this out - is this happening with any request?

@ParthSareen commented on GitHub (Apr 24, 2025): Hey @khteh will check this out - is this happening with any request?
Author
Owner

@khteh commented on GitHub (Apr 24, 2025):

It happens at rest

@khteh commented on GitHub (Apr 24, 2025): It happens at rest
Author
Owner

@khteh commented on GitHub (May 27, 2025):

Sorry, it happens when serving requests and every request. When can this be fixed?

@khteh commented on GitHub (May 27, 2025): Sorry, it happens when serving requests and every request. When can this be fixed?
Author
Owner

@jonigl commented on GitHub (May 30, 2025):

How do I filter out this warning from being logged?

you can try warnings.filterwarnings("ignore", category=DeprecationWarning, module="ollama")

@jonigl commented on GitHub (May 30, 2025): > How do I filter out this warning from being logged? you can try `warnings.filterwarnings("ignore", category=DeprecationWarning, module="ollama")`
Author
Owner

@khteh commented on GitHub (Jun 4, 2025):

Is this fixed? I don't see the warnings in the console anymore after updating my pipenv dependencies..?

@khteh commented on GitHub (Jun 4, 2025): Is this fixed? I don't see the warnings in the console anymore after updating my `pipenv` dependencies..?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#265