💻 Launch your websites with Cloudways — managed cloud hosting made easy:<br />https://go.watsontechworld.com/cloudways<br />---<br />Learn how to use OpenAI's new open-source models, GPT-OSS-120B and GPT-OSS-20B, with the Hugging Face API in Python. This tutorial covers setting up your API key, running queries, and comparing outputs between the two models. Full code provided!<br /><br />Subscribe / follow for more!<br />---<br />Code for video 👇<br />https://github.com/sinocelt/100daysofcode-2025-07/blob/main/gpt-oss-huggingface-api.ipynb<br />https://github.com/sinocelt/100daysofcode-2025-07/blob/main/code_for_teaching_hugging_face_with_gpt_oss_models.py<br />---<br />Our website: https://watsontechworld.com<br />---<br />00:00 Intro to GPT-OSS models<br />01:30 Intro to the code for the video<br />02:24 Discussing steps to use OSS models with Hugging Face p1<br />04:42 Getting Hugging Face code to use models<br />06:07 Discussing steps to use OSS models with Hugging Face p2<br />06:24 Getting an API key / access token<br />07:22 Adding Hugging Face token to Jupyter notebook code<br />08:36 Discussing steps to use OSS models with Hugging Face p3<br />08:58 Going through Jupyter Notebook code p1<br />09:54 Discussing getting exact model name on Hugging Face API<br />10:46 Going through Jupyter Notebook code p2<br />11:55 Photosynthesis question with gpt-oss-120b<br />13:22 Photosynthesis question output with gpt-oss-120b<br />15:16 Photosynthesis question with gpt-oss-20b<br />16:02 Photosynthesis question output with gpt-oss-20b<br />17:42 Going through Jupyter Notebook code p3 - reading in prompt from a file<br />18:25 Golf question with gpt-oss-20b<br />19:12 Golf question output with gpt-oss-20b<br />20:45 Golf question with gpt-oss-120b<br />21:02 Golf question output with gpt-oss-120b<br />22:55 Using Hugging Face key in an environment variable<br />24:28 Portuguese learning question with gpt-oss-20b<br />24:55 Portuguese learning question output with gpt-oss-20b<br />26:45 Portuguese learning question with gpt-oss-120b<br />26:57 Portuguese learning question output with gpt-oss-120b<br />30:13 Using the Python file<br />31:20 Copying Hugging Face API key into Python file<br />32:31 Data science question with gpt-oss-20b with Python file<br />34:02 Data science question output with gpt-oss-20b with Python file<br />36:39 Data science question with gpt-oss-120b with Python file<br />36:57 Data science question output with gpt-oss-120b with Python file<br />38:40 Review of how to use models with Hugging Face API<br />40:45 Review of Jupyter Notebook code p1<br />41:47 Review of setting prompt directly in Jupyter Notebook file or via a text file<br />43:02 Code that sends prompt to API<br />43:10 Discussing gpt-oss-20b vs gpt-oss-120b<br />43:37 Review of gpt-oss models on Hugging Face <br />44:08 Review of Jupyter Notebook code p2 - how to render the output well<br />45:21 Conclusion<br />---<br />#GPTOSS #HuggingFace #OpenAI #Python #HuggingFaceAPI #AI #OpenAIModels #OpenSource #OpenSourceAI #AITutorial #PythonTutorial #MachineLearning #LLM
