Python SDK, command-line tools, runnable recipes, and documentation for the Cortex Training REST API.
Requires Python 3.10 or later and uv. Create an environment and install the client:
uv venv
source .venv/bin/activate
uv pip install git+https://github.com/snowflakedb/cortex-training.gitThe package includes the CLI, log TUI, and Python SDK. pip install also works
in place of uv pip install in an active Python environment.
Create ~/cortex-training-config.json using the
connection template. Set host to
your Snowflake account hostname, pat to your programmatic access token, and
database and schema to the location of your Cortex Training endpoint.
Keep this file outside the repository and do not commit credentials.
Login validates the config and remembers its path for future CLI commands:
cortex-training login ~/cortex-training-config.jsonThe equivalent cortex-training login --config ~/cortex-training-config.json
form is also supported.
ct is an alias for cortex-training: every CLI example also works with ct.
See connection setup for more detail.
cortex-training capacity # Check available GPU capacity
cortex-training list # List jobs
cortex-training get JOB_ID # Inspect a job from the list
cortex-training tui # Pick a job and view its logsSee the CLI quick reference for submission, training, generation, checkpoints, and log downloads.
Start with Run a Quick SFT Job, a short end-to-end supervised fine-tuning walkthrough.
Recipes require a repository checkout; they are not included in the installed package:
git clone https://github.com/snowflakedb/cortex-training.git
cd cortex-trainingInstall the recipe dependencies, then run
the chosen recipe's commands from the repository root. Recipes take an explicit
config=/path/to/config.json argument; use the same connection file you logged
in with.
| Task | Recipe |
|---|---|
| Fine-tune a chat model with LoRA or full-parameter training | Conversational SFT |
| Train math reasoning with reinforcement learning | Math GRPO |
| Serve a model or checkpoint, generate responses, and evaluate | Inference endpoint |
Check cortex-training capacity and the recipe's GPU requirements before
starting a run. Browse the recipe index for all workflows.
- Getting started and prerequisites
- CLI commands and configuration
- Python SDK
- REST API
- Model and training-method compatibility
- Job management and cluster status
- RL framework integrations
From a repository checkout, with your Python environment active:
uv pip install -e ".[dev]"With uv installed, run:
./scripts/build_wheel.shThe script builds the package using pyproject.toml in an isolated build
environment and writes the wheel to dist/. It can be invoked from any working
directory and does not install the package's runtime dependencies.
| Path | Purpose |
|---|---|
model-catalog/ |
Supported models, context limits, and recommended job profiles |
docs/ |
Getting started material, concepts, guides, and reference |
recipes/ |
End-to-end training, sampling, and evaluation workflows |
examples/api/ |
Small JSON examples for individual API operations |
examples/config/ |
Connection configuration templates |
src/cortex_training/ |
Installable Python client |
tests/ |
Client and CLI tests |
cluster-status.py |
Optional watch view of running jobs and GPU usage |