Skip to content

Commit 4d900e3

Browse files
committed
Link dedicated full-FT runs to the active team
`_dispatch_full_finetune_run` was building the payload without a teamId, so every dispatched run landed on the caller's personal account even when `prime config view` showed a team selected. The LoRA path (rl.py:1216) already passes `app_config.team_id` — match that behaviour for the full-FT path. Backend's `CreateDedicatedRunRequest.team_id` is Optional, so the prior omission was silently wrong instead of returning a 400.
1 parent 1bc2610 commit 4d900e3

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

packages/prime/src/prime_cli/api/training.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def build_payload_from_toml(
5757
cfg: Dict[str, Any],
5858
*,
5959
name: Optional[str] = None,
60+
team_id: Optional[str] = None,
6061
image_tag: Optional[str] = None,
6162
wandb_api_key: Optional[str] = None,
6263
hf_token: Optional[str] = None,
@@ -73,13 +74,16 @@ def build_payload_from_toml(
7374
What stays out of `config`:
7475
- secrets (wandb / hf): materialised into a per-run k8s Secret,
7576
- run name: lives on the platform's RFTRun row, not the TOML,
77+
- team_id: links the RFTRun to a team for billing/access scoping,
7678
- image_tag: chart-level (which prime-rl image to pull).
7779
7880
Cluster targeting is backend-side (auto-pick first uncordoned).
7981
"""
8082
payload: Dict[str, Any] = {"config": cfg}
8183
if name:
8284
payload["name"] = name
85+
if team_id:
86+
payload["teamId"] = team_id
8387
if image_tag:
8488
payload["imageTag"] = image_tag
8589
if wandb_api_key:

packages/prime/src/prime_cli/commands/rl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,15 @@ def _dispatch_full_finetune_run(
749749

750750
name = raw_cfg.get("name")
751751

752+
# Link the dispatched run to the user's active team (same convention
753+
# as the LoRA path at line 1216). Without this, the RFTRun row gets
754+
# team_id=None and lands on the caller's personal account even when
755+
# the CLI is configured for a team — confusing for billing + access
756+
# scoping. Backend's `CreateDedicatedRunRequest.team_id` is Optional,
757+
# so omitting it is silently wrong rather than a 400.
758+
app_config = Config()
759+
team_id = app_config.team_id
760+
752761
# Resolve env files relative to the config dir, same convention as the
753762
# LoRA path. We don't validate WANDB presence here — the chart wires
754763
# WANDB_API_KEY via secretKeyRef only if `[wandb]` is configured AND
@@ -785,6 +794,7 @@ def _warn(msg: str) -> None:
785794
payload = build_payload_from_toml(
786795
raw_cfg,
787796
name=name,
797+
team_id=team_id,
788798
wandb_api_key=secrets.get("WANDB_API_KEY"),
789799
hf_token=secrets.get("HF_TOKEN"),
790800
)

0 commit comments

Comments
 (0)