river-client-training

river-client-training is a skill for Claude Code from riverai-org/river-skills. It costs 146 tokens per session (8,649 once invoked), scanned A, original, Apache-2.0.

A guide to using the river-client Python package to train models on River's remote GPUs. It covers LoRA fine-tuning, supervised fine-tuning, and reinforcement learning with GRPO, a method that improves models using scored results.

In plain words
What is it for?
Use it to write or review Python scripts that create River training sessions, train hosted models, work with live training weights, and label runs with experiment metadata.
Why use it?
It helps avoid outdated or incorrect code when connecting to River's training service, creating models, sending training data, sampling results, and saving checkpoints.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the river plugin — 1 skill shipped together

Good fit Use it to write or review Python scripts that create River training sessions, train hosted models, work with live training weights, and label runs with experiment metadata.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/riverai-org/river-skills/river-client-training
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add riverai-org/river-skills --skill river-client-training
Clone the repo
git clone --depth 1 https://github.com/riverai-org/river-skills

Made for: Claude Code.

Or install river, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for river-client-training

README.md
[![agentmods](https://agentmods.dev/badge/skills/riverai-org/river-skills/river-client-training/github.svg)](https://agentmods.dev/skills/riverai-org/river-skills/river-client-training)
Your own site
<a href="https://agentmods.dev/skills/riverai-org/river-skills/river-client-training"><img src="https://agentmods.dev/badge/skills/riverai-org/river-skills/river-client-training/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for river-client-training

Your own site · 80×15
<a href="https://agentmods.dev/skills/riverai-org/river-skills/river-client-training"><img src="https://agentmods.dev/badge/skills/riverai-org/river-skills/river-client-training.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 146 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,649 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00146 $0.08649
Opus 5 $0.00073 $0.04325
Sonnet 5 $0.00029 $0.01730
Haiku 4.5 $0.00015 $0.00865

Measured 9d ago against content hash 23ae1da1ba57, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

river-client-training scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/river-client-training/SKILL.md · 766 lines

How it starts

The opening of the file, as written. The whole thing — 766 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Train with river_client (the current API)

river_client is the Python client for River's training API: create a LoRA model on remote GPU workers inside a session, push training data through train_step, sample from the live weights, checkpoint. This skill is the short path to writing a correct script with the current API (train_step era, package ≥ 0.5).

Setup and connection

pip install river-client        # PyPI, Python 3.12+
import os

import river_client as river

client = river.Client(api_key=os.environ["RIVER_API_KEY"], endpoint="api.river.ai")

Everything happens inside a session (the GPU allocation) and a model:

with client.session() as session:
    model = session.create_model(
        base_model="Qwen/Qwen3.6-35B-A3B-FP8",
        lora=river.LoraConfig(rank=16, train_unembed=True),  # see note below
    )
    ...
# GPUs freed automatically on exit.

Any keyword arguments to client.session(...) become session tags — arbitrary string key→value metadata stamped on the session:

with client.session(experiment="grpo-math", run="lr4e-5-r16") as session:
    ...

Tags don't change behavior; they exist so runs can be found later: the River Console can filter training runs by tag, and tags travel with the run for correlating against an external experiment tracker (a common convention is client.session(wandb_project=..., wandb_name=...)). Tag long-running experiments — an untagged session is hard to tell apart from every other one once you have dozens. Key/value counts and lengths are bounded server-side, so keep them short labels, not payloads.

LoraConfig knobs: rank (max 32), train_attn / train_mlp (both default on), train_unembed (default off), seed (reproducible adapter init).

Why train_unembed=True for RL. The unembedding (lm_head) is the final hidden-state → vocab-logits matrix; this flag adds a LoRA adapter on it. With the head frozen, a policy update can only change token probabilities indirectly, by bending hidden states through the trunk adapters. The RL losses (importance_sampling / ppo / cispo) are exactly "push probability toward or away from these sampled tokens, weighted by advantage" — a gradient that lands first on the logits — and RL's signal is one scalar reward per sequence, so you want it expressible as directly as possible. A head adapter gives that direct lever (suppress premature EOS, boost format tokens, sharpen the distribution) without spending trunk capacity — and without it, updates burn more KL (kl, mean_ratio drift) for less reward gain. For SFT the dense per-token cross-entropy signal usually makes trunk adapters sufficient, which is why the flag defaults off; turn it on for RL loops.

Read the full file on GitHub · 766 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 766 lines · 146 tokens per session scan A 23ae1da1ba57

Subscribe to this mod's changes

river-client-training is a skill published in the GitHub repository riverai-org/river-skills (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 146 tokens to every session and 8,649 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

accelerate

Run PyTorch training across GPUs with minimal changes.

NousResearch/hermes-agent · 13 tokens

optimize-for-gpu

GPU-accelerates scientific Python on NVIDIA hardware and verifies that the result is correct and faster. Use for CUDA/GPU optimization; CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX, scikit-image, vector-search, image-processing, graph, simulation, or file-I/O workloads; CuPy, cuDF, cuML, cuGraph, cuVS…

K-Dense-AI/scientific-agent-skills · 151 tokens

developing-genkit-python

Develop AI-powered applications using Genkit in Python. Use when the user asks about Genkit, AI agents, flows, or tools in Python, or when encountering Genkit errors, import issues, or API problems.

google/skills · 49 tokens

marimo-pair

Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.

marimo-team/marimo · 57 tokens

minicpm5-deploy-transformers

Run MiniCPM5-1B or MiniCPM5-2B with Hugging Face Transformers for one-shot Python generation on GPU (bfloat16) or CPU (float32). Use when the user wants a quick Python script, no server, no extra deps, or asks for "Transformers", "AutoModelForCausalLM", "model.generate" with MiniCPM5.

OpenBMB/MiniCPM · 90 tokens

azure-mgmt-fabric-py

Azure Fabric Management SDK for Python. Use for managing Microsoft Fabric capacities and resources. Triggers: "azure-mgmt-fabric", "FabricMgmtClient", "Fabric capacity", "Microsoft Fabric", "Power BI capacity".

microsoft/skills · 51 tokens