huggingface / huggingface/agents-course

[HANDS-ON BUG] Error in chat completion in unit 1 dummy agent library

Open
#627 3 comments 1 reaction 0 assignees View on GitHub
hands-on-bug
Dominant language
MDX
Stars
32.6k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Getting error 'the requested model is not a chat model' while running the code given in dummy agent library

**To Reproduce**
```
import os
from huggingface_hub import InferenceClient

HF_TOKEN = os.environ.get("HF_TOKEN")

client = InferenceClient(model="meta-llama/Llama-4-Scout-17B-16E-Instruct")

output = client.chat.completions.create(
messages=[
{"role": "user", "content": "The capital of France is"},
],
stream=False,
max_tokens=20,
)
print(output.choices[0].message.content)
```

getting the error as,
```
Bad request:
{'message': "The requested model 'meta-llama/Llama-4-Scout-17B-16E-Instruct' is not a chat model.", 'type': 'invalid_request_error', 'param': 'model', 'code': 'model_not_supported'}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by searching the course content for the Unit 1 dummy agent library example and reproduce the shown InferenceClient call with the named model. Check the current Hugging Face model and chat-completion support, then update the example or model reference so the exercise runs successfully and verify the output path.

Written by the indexing model from the issue text.

Assessment

Tech stack
huggingface, python
Domain
ai, documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.