C.W.K.
Stream
Lesson 10 of 12 · published

Model registry

~10 min · registry, versioning, mlops

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

모델도 versioning 필요

'새 모델 학습함' 은 정보 부족. 어느 모델? 어떤 데이터? 어느 commit 이 생산? 어떻게 점수? Model registry 가 이걸 답함.

흔한 registry

  • Hugging Face Hub — public default; private org 지원.
  • MLflow — open-source, self-host 가능.
  • Weights & Biases (W&B) — 전체 실험 추적 + registry.
  • SageMaker Model Registry — AWS native.
  • Vertex AI Model Registry — GCP native.

기록할 metadata

  1. Source SHA (모델 생산한 Git commit).
  2. 학습 데이터 버전 (DVC 버전, dataset SHA, S3 etag).
  3. Hyperparameter.
  4. Hold-out 세트 eval 점수.
  5. 학습 환경 (Docker image SHA, GPU 유형, 라이브러리 버전).
  6. Promotion stage (staging / production / archived).

CI 통합

성공한 학습 job 이 모델을 'staging' 으로 registry 에 업로드. 별도 workflow (수동 또는 예약) 가 eval gate 통과 후 'production' 으로 승격. 서빙 stack 이 시작 시 'production' pull.

Code

성공 시 학습 모델을 HF Hub 에 push·yaml
      - name: Train
        run: uv run python train.py --output ./out/
      - name: Eval
        id: eval
        run: |
          score=$(uv run python eval.py --model ./out/ --json | jq -r .accuracy)
          echo "score=$score" >> $GITHUB_OUTPUT
      - name: Push to HF Hub (staging only)
        if: steps.eval.outputs.score > 0.85
        env:
          HF_TOKEN: ${{ secrets.HF_TOKEN }}
        run: |
          uv run python -c "
          from huggingface_hub import HfApi
          HfApi().upload_folder(
            folder_path='./out',
            repo_id='my-org/my-model',
            revision='staging',
            commit_message='train: ${{ github.sha }} score=${{ steps.eval.outputs.score }}',
          )
          "

External links

Exercise

스택에 맞는 registry 선택. 학습 run 하나가 결과 모델을 metadata 와 함께 push 하도록 연결. Eval gate 요구하는 별도 workflow 통해 staging 에서 production 으로 승격.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.