pytrio

Document PyTRIO SDK usage for remote training and inference with Qwen models.

17|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/SwanHubX/pytrio-skill --skill pytrio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytrio
Source: https://github.com/SwanHubX/pytrio-skill/tree/main/src
Command: npx skills add https://github.com/SwanHubX/pytrio-skill --skill pytrio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Claude Code and other assistants generate invalid PyTRIO usage because they do not know the remote training and inference flow, credential requirements, or naming differences from HuggingFace APIs, so the same mistakes keep recurring.

Core Features & Use Cases

  • Credential and concept checklist: Covers trio login, ServiceClient creation, PyTorch-to-PyTRIO concept mapping, and how loss functions, ModelInput wrapping, and AdamParams differ from local training.
  • API quick references: Details the training, sampling, and rest clients plus Datum/SamplingParams structures so you can construct correct pipelines, save checkpoints, and resume or sample from LoRA weights.
  • Trap list and best practices: Explains issues such as max_tokens vs max_new_tokens, weights masking, prompt autoshift rules, and the requirement to use Qwen/Qwen3-4B-Instruct-2507 for training, with runnable examples stored under examples/ and best-practices/.

Quick Start

Ask Claude Code to plan how to log in via trio login, wrap training samples with ModelInput, call forward_backward and optim_step, and save sampler weights for inference.

Frequently Asked Questions about pytrio

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run remote LLM training and inference with PyTRIO?

To run remote LLM training and inference with PyTRIO, use the trio login CLI, wrap samples with ModelInput, call forward_backward and optim_step, then save sampler weights for inference.

How does PyTRIO remote training differ from local PyTorch training?

PyTRIO remote training differs from local PyTorch by requiring ServiceClient creation, ModelInput wrapping, Datum losses, and AdamParams defaults, alongside specific credential and concept mapping rules.

What are the common pitfalls when using PyTRIO for LoRA fine-tuning?

Common PyTRIO LoRA fine-tuning pitfalls include confusing max_tokens with max_new_tokens, incorrect weights masking, prompt autoshift rules, and failing to use Qwen/Qwen3-4B-Instruct-2507 for training.

How do I save and resume checkpoints during remote LLM training?

To save and resume checkpoints during remote LLM training, use the PyTRIO training client and REST operations to save checkpoints, then resume or sample directly from the saved LoRA weights.

Do I need specific credentials to use the sampling client for LLM inference?

Yes, using the PyTRIO sampling client for LLM inference requires completing the trio login process and configuring ServiceClient creation with proper SamplingParams before executing inference calls.

Why does my PyTRIO training pipeline fail with incorrect prompt masking?

PyTRIO training pipelines fail with incorrect prompt masking because the framework applies specific prompt autoshift rules that must be followed exactly to prevent loss calculation errors.