Skip to main content

cog-review

Cog architecture and cross-cutting review guidelines

소스 정보

저장소
replicate/cog
최근 소스 활동
2026년 3월 31일 13:25
감지된 SKILL.md 언어
영어
스타
9,490
포크
699

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
cog-review
description
Cog architecture and cross-cutting review guidelines
## Cog architecture review guidelines Cog packages ML models into production-ready containers. Use this skill for changes that cross language boundaries or touch core architecture. ### Component overview - **CLI** (Go): `cmd/cog/` and `pkg/` -- builds, runs, and deploys models - **Python SDK**: `python/cog/` -- predictor interface, types, HTTP/queue server - **Coglet** (Rust): `crates/` -- prediction server inside containers (HTTP, worker management, IPC) ### Key design patterns **Wheel resolution**: The CLI discovers SDK and coglet wheels from `dist/` at Docker build time. Wheels are NOT embedded in the binary. Changes to build artifacts need to account for this. **Dockerfile generation**: `pkg/dockerfile/` generates Dockerfiles from `cog.yaml` config. Template injection and escaping matter here. **Config parsing**: `pkg/config/config.go` parses `cog.yaml`. Schema is at `pkg/config/data/config_schema_v1.0.json`. Changes must keep schema and Go code in sync. **Two-process coglet**: Parent process (HTTP server + orchestrator) and child worker process (Python predictor execution) communicate via IPC. Changes to the IPC protocol affect both Rust and Python code. **Compatibility matrix**: CUDA/PyTorch/TensorFlow compatibility is managed in `tools/compatgen/`. Framework version changes have wide blast radius. ### Cross-cutting concerns - **VERSION.txt** is the single source of truth for versioning. `Cargo.toml` must match. - Changes to `python/cog/base_predictor.py` affect all downstream model authors. - Changes to `docs/` require running `mise run docs:llm` to regenerate `docs/llms.txt`. - CLI reference docs are auto-generated -- changes to `cmd/` or `pkg/cli/` require `mise run docs:cli`. - Integration tests in `integration-tests/` use Go's testscript and need a built cog binary. ### What to watch for - Breaking changes to the predictor interface or cog.yaml schema - Docker build changes that affect layer caching or build time - IPC protocol changes without updating both Rust and Python sides - Version bumps that miss one of the places VERSION.txt needs to match - New ML framework versions without compatibility testing
GitHub에서 보기