Cortex Training Client
Python SDK, command-line tools, runnable recipes, and documentation for the Cortex Training REST API.
Install
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.git
The package includes the CLI, log TUI, and Python SDK. pip install also works
in place of uv pip install in an active Python environment.
Log In
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.json
The 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.
Try the CLI
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 logs
See the CLI quick reference for submission, training, generation, checkpoints, and log downloads.
Run a Recipe
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-training
Install 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.
More Documentation
- Getting started and prerequisites
- CLI commands and configuration
- Python SDK
- REST API
- Model and training-method compatibility
- Job management and cluster status
Development
Editable Install
From a repository checkout, with your Python environment active:
uv pip install -e ".[dev]"
Build a Wheel
With uv installed, run:
./scripts/build_wheel.sh
The 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.
Repository Map
| 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 |
Release files for cortex-training 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cortex_training-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / cortex_training-0.0.3-py3-none-any.whl
| Download URL | cortex_training-0.0.3-py3-none-any.whl |
|---|---|
| Size | 78.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fe2db120affca7bf33134ea4818112f059b90a49bbeb8f57ad839343541578e
|
|
BLAKE2b-256 checksum How to use checksums |
961dd0202ae4dcf1b2bf3d0725fd098733fddbd8cdb58e1bff96a62a9c9a3f50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|