# Running Locally Error

**URL:** <https://community.deeplearning.ai/t/running-locally-error/787006>\
**Category:** Long-Term Agentic Memory with LangGraph\
**Tags:** project, ai-discussions\
**Created:** [March 18, 2025, 4:17am UTC](https://community.deeplearning.ai/t/running-locally-error/787006 "2025-03-18T04:17:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masih](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Masih](https://community.deeplearning.ai/u/Masih)\
**Post date:** [March 18, 2025, 4:17am UTC](https://community.deeplearning.ai/t/running-locally-error/787006/1 "2025-03-18T04:17:47Z")

</div>

Hello, I’m trying to run the codes locally using ollama, but I get an attribute error after running:

llm\_router = llm.with\_structured\_output(Router)

* * *

AttributeError Traceback (most recent call last)  
Cell In[37], line 1  
----\> 1 llm\_router = llm.with\_structured\_output(Router)

AttributeError: ‘str’ object has no attribute ‘with\_structured\_output’

* * *

This is how I load my LLM:

from ollama import chat

# Model configurations

llm = ‘gemma3’

def generate\_response(prompt):  
“”“Generate response using specified LLM model”“”  
response = chat(model=llm, messages=[{‘role’: ‘user’, ‘content’: prompt}])  
return response[‘message’][‘content’]

# Example usage

if **name** == “ **main** ”:  
response = generate\_response(“Hello, how are you?”)  
print(response)

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/178017_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [March 18, 2025, 10:14am UTC](https://community.deeplearning.ai/t/running-locally-error/787006/2 "2025-03-18T10:14:53Z")

</div>

you haven’t downloaded all the required files to run the codes locally.

Also make sure you go through the requirement.txt file which provides information about all the module version one need to have for codes run successfully in your local environment

---

<div class="post-metadata">

**Author:** ![Masih](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Masih](https://community.deeplearning.ai/u/Masih)\
**Post date:** [April 3, 2025, 2:58pm UTC](https://community.deeplearning.ai/t/running-locally-error/787006/4 "2025-04-03T14:58:11Z")

</div>

Hi again, I’m sorry for getting back to you so late as I did not receive a notification of your response.

I have installed the requirements; later on it doesn’t recognize any memory\_store in langmem. I’ve installed langmam and langgraph though.

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/178017_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [April 3, 2025, 3:54pm UTC](https://community.deeplearning.ai/t/running-locally-error/787006/5 "2025-04-03T15:54:31Z")

</div>

does the installed version match with course provided version for both the modules

---

<div class="post-metadata">

**Author:** ![Masih](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Masih](https://community.deeplearning.ai/u/Masih)\
**Post date:** [May 1, 2025, 11:17am UTC](https://community.deeplearning.ai/t/running-locally-error/787006/6 "2025-05-01T11:17:06Z")

</div>

Yes I’m using the exact code from the session, I’ve only used gemma3 instead of OpenAI.
