{"data":{"slug":"huggingface-open-r1","name":"open-r1","tagline":"Fully open reproduction of DeepSeek-R1","github_url":"https://github.com/huggingface/open-r1","owner":"huggingface","repo":"open-r1","owner_avatar_url":"https://avatars.githubusercontent.com/u/25720743?v=4","primary_language":"Python","stars":26401,"forks":2446,"topics":[],"archived":false,"github_pushed_at":"2026-04-02T14:03:15+00:00","maintenance_label":"Slowing","url":"https://www.graphcanon.com/tools/huggingface-open-r1","markdown_url":"https://www.graphcanon.com/tools/huggingface-open-r1.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/huggingface-open-r1","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=huggingface-open-r1","description":"Fully open reproduction of DeepSeek-R1","homepage_url":null,"license":"Apache-2.0","open_issues":340,"watchers":281,"ai_summary":"Open-source project aiming to replicate the DeepSeek-R1 models and its training pipelines. Involves model distillation, RL pipeline replication, and multi-stage training.","readme_excerpt":"### Plan of attack\n\nWe will use the DeepSeek-R1 [tech report](https://github.com/deepseek-ai/DeepSeek-R1) as a guide, which can roughly be broken down into three main steps:\n\n* Step 1: replicate the R1-Distill models by distilling a high-quality corpus from DeepSeek-R1.\n* Step 2: replicate the pure RL pipeline that DeepSeek used to create R1-Zero. This will likely involve curating new, large-scale datasets for math, reasoning, and code.\n* Step 3: show we can go from base model to RL-tuned via multi-stage training.\n\n<center>\n    <img src=\"assets/plan-of-attack.png\" width=\"500\">\n</center>\n\n---\n\n## Installation\n\n> [!CAUTION]\n> Libraries rely on CUDA 12.4. If you see errors related to segmentation faults, double check the version your system is running with `nvcc --version`.\n\nTo run the code in this project, first, create a Python virtual environment using e.g. `uv`.\nTo install `uv`, follow the [UV Installation Guide](https://docs.astral.sh/uv/getting-started/installation/).\n\n\n> [!NOTE]\n> As a shortcut, run `make install` to setup development libraries (spelled out below). Afterwards, if everything is setup correctly you can try out the Open-R1 models.\n\n\n```shell\nuv venv openr1 --python 3.11 && source openr1/bin/activate && uv pip install --upgrade pip\n```\n\n> [!TIP]\n> For Hugging Face cluster users, add `export UV_LINK_MODE=copy` to your `.bashrc` to suppress cache warnings from `uv`\n\nNext, install vLLM and FlashAttention:\n\n```shell\nuv pip install vllm==0.8.5.post1\nuv pip install setuptools && uv pip install flash-attn --no-build-isolation\n```\n\nThis will also install PyTorch `v2.6.0` and it is **very important** to use this version since the vLLM binaries are compiled for it. You can then install the remaining dependencies for your specific use case via `pip install -e .[LIST OF MODES]`. For most contributors, we recommend:\n\n```shell\nGIT_LFS_SKIP_SMUDGE=1 uv pip install -e \".[dev]\"\n```\n\nNext, log into your Hugging Face and Weights and Biases accounts as follows:\n\n```shell\nhuggingface-cli login\nwandb login\n```\n\nFinally, check whether your system has Git LFS installed so that you can load and push models/datasets to the Hugging Face Hub:\n\n```shell\ngit-lfs --version\n```\n\nIf it isn't installed, run:\n\n```shell\nsudo apt-get install git-lfs\n```","github_created_at":"2025-01-24T15:44:11+00:00","created_at":"2026-07-11T10:30:06.623821+00:00","updated_at":"2026-07-12T06:00:24.701946+00:00","categories":[{"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"},{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"}],"tags":[{"slug":"deepseek-r1","name":"deepseek-r1"},{"slug":"rl-pipeline","name":"rl pipeline"},{"slug":"vllm","name":"vllm"},{"slug":"python","name":"python"},{"slug":"cuda","name":"cuda"},{"slug":"flashattention","name":"flashattention"},{"slug":"model-distillation","name":"model distillation"},{"slug":"multi-stage-training","name":"multi-stage training"}],"trust":{"provenance":{"is_fork":false,"github_id":921777121,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-07-12T06:00:13.302Z","maintenance":{"label":"Slowing","score":36,"methodology":"github_public_v1","releases_90d":0,"days_since_push":100,"last_release_at":null},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T10:30:08.677Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-07-12T06:00:19.393Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-07-12T06:00:19.393Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-07-12T06:00:19.393Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":{"notes":["Installation requires CUDA version 12.4 and PyTorch v2.6.0, with specific dependencies like vLLM and FlashAttention that are critical."],"min_ram_gb":8,"requires_docker":false},"constraints":{"min_ram_gb":8,"requires_docker":false},"when_to_use":["Use Open-R1 when you need a detailed understanding of how DeepSeek-R1 operates, considering the project closely mirrors its architecture and processes.","Open-R1 is ideal if your system setup includes CUDA 12.4, as it can take advantage of specific compiled binaries for vLLM that require PyTorch `v2.6.0`."],"when_not_to_use":["Avoid Open-R1 if your hardware does not support CUDA 12.4 or cannot run PyTorch `v2.6.0`, as this may lead to errors.","Do not use it if the need for rapid experimentation outweighs the value of detailed replication, since the multi-stage training and datasets curation process can be time-consuming."],"source":"enrich:decision_facts","observed_at":"2026-07-11T10:55:13.803Z"},"constraint_facets":{"min_ram_gb":8,"requires_docker":false},"decision_summary":[{"label":"Requirements","value":"Min 8 GB RAM; Installation requires CUDA version 12.4 and PyTorch v2.6.0, with specific dependencies like vLLM and FlashAttention that are critical."},{"label":"Adopt for","value":"Open-R1 is an open-source effort to replicate DeepSeek-R1's models and training pipelines involving model distillation, RL pipeline replication, and multi-stage training."},{"label":"License detail","value":"The project is licensed under Apache-2.0, providing a permissive license that allows for free use, modification, and distribution."}]}}