Modified "First Agent Template" from HuggingFace Agent Course: Unit 1
Original template from Huggingface Spaces can found here.
The purpose and goal of the modifications:
- To run examples locally instead of on Hugging Face Spaces
- To demonstrate connecting to other models and providers via OpenRouter and test interactions with them
- … and since LiteLLM is used, not only with OpenRouter
- Replace the Gradio web interface with a simple CLI chat.
- Clone this repo.
cdto cloned repo.- Copy
.env.exampleto.envand add your API key for OpenRouter. python -m venv .venvsource .venv/bin/activatepip install -r requirements.txt
Run the agent: python app.py
Enjoy!