# JSONDecodeError

**URL:** <https://community.deeplearning.ai/t/jsondecodeerror/890058>\
**Category:** Prompt Engineering with Llama 2\
**Created:** [March 9, 2026, 12:06am UTC](https://community.deeplearning.ai/t/jsondecodeerror/890058 "2026-03-09T00:06:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hal9](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@hal9](https://community.deeplearning.ai/u/hal9)\
**Post date:** [March 9, 2026, 12:06am UTC](https://community.deeplearning.ai/t/jsondecodeerror/890058/1 "2026-03-09T00:06:18Z")

</div>

Prompt Engineering with Llama 2&3

I got the following error whenever I ran any code. For Example: In Lesson2 :

> ## --------------- from utils import llama
> 
> ## prompt = “Help me write a birthday card for my dear friend Andrew.”
> 
> ## response = llama(prompt) print(response)
> 
> * * *
> 
> JSONDecodeError Traceback (most recent call last)  
> File /usr/local/lib/python3.10/site-packages/requests/models.py:971, in Response.json(self, \*\*kwargs)  
> 970 try:  
> → 971 return complexjson.loads(self.text, \*\*kwargs)  
> 972 except JSONDecodeError as e:  
> 973 # Catch JSON-related errors and raise as requests.JSONDecodeError  
> 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
> 
> File /usr/local/lib/python3.10/json/\__init_\_.py:346, in loads(s, cls, object\_hook, parse\_float, parse\_int, parse\_constant, object\_pairs\_hook, \*\*kw)  
> 343 if (cls is None and object\_hook is None and  
> 344 parse\_int is None and parse\_float is None and  
> 345 parse\_constant is None and object\_pairs\_hook is None and not kw):  
> → 346 return \_default\_decoder.decode(s)  
> 347 if cls is None:
> 
> File /usr/local/lib/python3.10/json/decoder.py:337, in JSONDecoder.decode(self, s, \_w)  
> 333 “”“Return the Python representation of ``s`` (a ``str`` instance  
> 334 containing a JSON document).  
> 335  
> 336 “””  
> → 337 obj, end = self.raw\_decode(s, idx=\_w(s, 0).end())  
> 338 end = \_w(s, end).end()
> 
> File /usr/local/lib/python3.10/json/decoder.py:355, in JSONDecoder.raw\_decode(self, s, idx)  
> 354 except StopIteration as err:  
> → 355 raise JSONDecodeError(“Expecting value”, s, err.value) from None  
> 356 return obj, end
> 
> JSONDecodeError: Expecting value: line 1 column 1 (char 0)
> 
> During handling of the above exception, another exception occurred:
> 
> JSONDecodeError Traceback (most recent call last)  
> Cell In[16], line 2  
> 1 # pass prompt to the llama function, store output as ‘response’ then print  
> ----\> 2 response = llama(prompt)  
> 3 print(response)
> 
> File ~/work/L2/utils.py:56, in llama(prompt, add\_inst, model, temperature, max\_tokens, verbose, url, headers, base, max\_tries)  
> 54 except Exception as e:  
> 55 if response.status\_code != 500:  
> —\> 56 return response.json()  
> 58 print(f"error message: {e}“)  
> 59 print(f"response object: {response}”)
> 
> File /usr/local/lib/python3.10/site-packages/requests/models.py:975, in Response.json(self, \*\*kwargs)  
> 971 return complexjson.loads(self.text, \*\*kwargs)  
> 972 except JSONDecodeError as e:  
> 973 # Catch JSON-related errors and raise as requests.JSONDecodeError  
> 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError  
> → 975 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
> 
> JSONDecodeError: Expecting value: line 1 column 1 (char 0)  
> ---------------------------------------------------------------------------

I did the following actions, but they did not help.

- Reload the page
- log in and log out
- use different browser
- clear my web browser’s cache and cookies
- “Restore Original Version” from three-dot menu (⋮)

Any input will be appreciated.

 ![image](https://global.discourse-cdn.com/dlai/original/3X/9/3/93d698ad4e6b5d812f2118259ae6e203b5bb6cb7.png)

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [March 13, 2026, 5:11pm UTC](https://community.deeplearning.ai/t/jsondecodeerror/890058/2 "2026-03-13T17:11:42Z")

</div>

Hi @hal9 !  
looking at this notebook (released in Feb 2024) I can see there might be issues related to the key or a deprecated endpoint. I will check it with the team and will update these notebooks.

Thank you for reporting!

---

<div class="post-metadata">

**Author:** ![Tom\_Cates](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@Tom\_Cates](https://community.deeplearning.ai/u/Tom_Cates)\
**Post date:** [June 25, 2026, 12:18pm UTC](https://community.deeplearning.ai/t/jsondecodeerror/890058/3 "2026-06-25T12:18:18Z")

</div>

Hello, I am seeing the same error with Prompt Engineering with Llama 2 & 3. This course was the reason I signed up. Is there an ETA for this to be looked into? Thanks!

---

<div class="post-metadata">

**Author:** ![Tom\_Cates](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@Tom\_Cates](https://community.deeplearning.ai/u/Tom_Cates)\
**Post date:** [June 25, 2026, 12:37pm UTC](https://community.deeplearning.ai/t/jsondecodeerror/890058/4 "2026-06-25T12:37:16Z")

</div>

```auto
### status code: 404 for url: http://jupyter-api-proxy.internal.dlai/rev-proxy/meta_together/inference

```

@lesly.zerna

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [June 30, 2026, 4:22pm UTC](https://community.deeplearning.ai/t/jsondecodeerror/890058/5 "2026-06-30T16:22:52Z")

</div>

> [@hal9](#):
>
> Prompt Engineering with Llama 2&3

This isn’t a typo in `model=` — it’s DLAI’s internal API proxy. The notebook’s network calls in this hosted classroom get routed through `http://jupyter-api-proxy.internal.dlai/rev-proxy/meta_together/inference`, where `meta_together` is a fixed routing segment in their proxy config, not something we control. Together.ai deprecated the old `/inference` endpoint this proxy was built for, so the route is now dead on Together’s side and the proxy returns 404 / “Accessing meta\_together is invalid.”

I’ve been testing locally using:

```auto
model="meta-llama/Llama-3-8b-chat-hf"

```

instead of

```auto
model="togethercomputer/llama-2-7b-chat"

```

seems better! Check also this [thread](https://community.deeplearning.ai/t/error-when-running-jupyter-code/685754/9).

We’ll be updating the notebooks in the following weeks.

Happy Learning!

-- Lesly, DLAI
