{"data":{"slug":"rasbt-reasoning-from-scratch","name":"reasoning-from-scratch","tagline":"Implement a reasoning LLM in PyTorch from scratch, step by step","github_url":"https://github.com/rasbt/reasoning-from-scratch","owner":"rasbt","repo":"reasoning-from-scratch","owner_avatar_url":"https://avatars.githubusercontent.com/u/5618407?v=4","primary_language":"Jupyter Notebook","stars":4998,"forks":759,"topics":["ai","artificial-intelligence","chain-of-thought","deep-learning","distillation","grpo","inference-time-scaling","large-language-models","llm","llms","machine-learning","math-reasoning","python","pytorch","reasoning","reasoning-models","reinforcement-learning","rlhf","test-time-compute"],"archived":false,"github_pushed_at":"2026-08-04T16:07:42+00:00","maintenance_label":"Active","stars_delta_30d":252,"url":"https://www.graphcanon.com/tools/rasbt-reasoning-from-scratch","markdown_url":"https://www.graphcanon.com/tools/rasbt-reasoning-from-scratch.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/rasbt-reasoning-from-scratch","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=rasbt-reasoning-from-scratch","description":"Implement a reasoning LLM in PyTorch from scratch, step by step","homepage_url":"https://mng.bz/lZ5B","license":"Apache-2.0","open_issues":2,"watchers":61,"ai_summary":"A step-by-step guide to implement a reasoning large language model using PyTorch. The repository provides detailed instructions, suitable for running on consumer hardware including automatic GPU utilization where available.","readme_excerpt":"## Hardware Requirements\n\nThe code in the main chapters of this book is designed to mostly run on consumer hardware within a reasonable timeframe and does not require specialized server hardware. This approach ensures that a wide audience can engage with the material. Additionally, the code automatically utilizes GPUs if they are available. That being said, chapters 2-4 will work well on CPUs and GPUs. For chapters 5 and 6, it is recommended to use a GPU if you want to replicate the results in the chapter.\n\n\n(Please see the [setup_tips](ch02/02_setup-tips/python-instructions.md) doc for additional recommendations.)\n\n&nbsp;","github_created_at":"2025-03-04T14:24:26+00:00","created_at":"2026-07-07T17:35:04.654737+00:00","updated_at":"2026-08-17T12:01:26.568897+00:00","categories":[{"slug":"llm-frameworks","name":"LLM Frameworks","url":"https://www.graphcanon.com/categories/llm-frameworks","markdown_url":"https://www.graphcanon.com/categories/llm-frameworks.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/llm-frameworks"},{"slug":"model-training","name":"Model Training","url":"https://www.graphcanon.com/categories/model-training","markdown_url":"https://www.graphcanon.com/categories/model-training.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/model-training"}],"tags":[{"slug":"ai","name":"ai"},{"slug":"artificial-intelligence","name":"artificial-intelligence"},{"slug":"chain-of-thought","name":"chain-of-thought"},{"slug":"deep-learning","name":"deep-learning"},{"slug":"distillation","name":"distillation"},{"slug":"inference-time-scaling","name":"inference-time-scaling"},{"slug":"large-language-models","name":"large language models"},{"slug":"machine-learning","name":"machine-learning"}],"trust":{"provenance":{"is_fork":false,"github_id":942696497,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-17T12:01:25.806Z","maintenance":{"label":"Active","score":82,"methodology":"github_public_v1","releases_90d":0,"days_since_push":12,"last_release_at":"2026-05-18T15:27:27Z","stars_delta_30d":252,"open_issues_delta_30d":0},"security_summary":{"status":"findings","scanner":"osv@v1","low_count":15,"high_count":0,"last_scan_at":"2026-07-11T11:04:46.277Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-17T12:01:26.279Z"},"languages":{"value":["jupyter notebook","python"],"source":"github.language+pyproject.toml","observed_at":"2026-08-17T12:01:26.279Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-08-17T12:01:26.279Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":{"notes":["Automatic GPU utilization where available, though not strictly necessary for the early chapters."],"min_ram_gb":null,"requires_docker":false},"constraints":{"min_ram_gb":null,"requires_docker":false},"when_to_use":["When you have intermediate knowledge of PyTorch and want detailed insights into the implementation process of reasoning LLMS.","If you prefer material that can run primarily on consumer-grade hardware, allowing flexibility in your development environment."],"when_not_to_use":["Avoid this tool if you are looking for rapid prototyping or quick model deployment; it focuses more on understanding and building the LLM from scratch rather than providing prebuilt components.","If specialized server hardware is available and preferred for the entire project, as chapters 5 and 6 recommend GPU use but earlier sections can be completed with just a CPU."],"source":"enrich:decision_facts","observed_at":"2026-07-12T13:54:25.224Z"},"constraint_facets":{"min_ram_gb":null,"requires_docker":false},"decision_summary":[{"label":"Requirements","value":"Automatic GPU utilization where available, though not strictly necessary for the early chapters."},{"label":"Adopt for","value":"A step-by-step guide to building a reasoning large language model (LLM) using PyTorch, suitable for running on consumer hardware with automatic GPU utilization."},{"label":"License detail","value":"Apache-2.0 License"}]}}