본문으로 건너뛰기
cccskills
무료GitHub에 공개

renderers

Guide for using renderers — the bridge between chat-style messages and token sequences. Covers renderer setup, TrainOnWhat, vision inputs, model family matching, and custom renderers. Use when the user asks about renderers, tokenization, message formatting, or vision inputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Renderers

Renderers convert chat-style messages into token sequences for training and generation.

Reference

Read these for details:

  • tinker_cookbook/renderers/base.py — Renderer base class and API
  • tinker_cookbook/renderers/__init__.py — Registry, factory, TrainOnWhat enum
  • docs/rendering.mdx — Rendering guide with examples

Getting a renderer

Always use model_info.get_recommended_renderer_name() — never hardcode:

from tinker_cookbook import model_info
from tinker_cookbook.renderers import get_renderer
from tinker_cookbook.tokenizer_utils import get_tokenizer

renderer_name = model_info.get_recommended_renderer_name(model_name)
tokenizer = get_tokenizer(model_name)
renderer = get_renderer(renderer_name, tokenizer)

Available renderers: llama3, qwen3, deepseekv3, kimi_k2, kimi_k25, nemotron3, nemotron3_disable_thinking, role_colon, and more. See tinker_cookbook/renderers/__init__.py for the full registry.

Key renderer methods

# Build generation prompt (for sampling)
model_input = renderer.build_generation_prompt(messages, role="assistant")

# Build supervised example (for training)
model_input, weights = renderer.build_supervised_example(
    messages, train_on_what=TrainOnWhat.ALL_ASSISTANT_MESSAGES
)

# Parse model output back to a message
message, is_complete = renderer.parse_response(token_ids)

# Get stop sequences for sampling
stop = renderer.get_stop_sequences()

# Tool calling support
prefix_messages = renderer.create_conversation_prefix_with_tools(tool_specs)

TrainOnWhat

Controls which tokens receive training signal:

from tinker_cookbook.renderers import TrainOnWhat

# Most common — train on all assistant responses
TrainOnWhat.ALL_ASSISTANT_MESSAGES

# Train only on the final assistant response
TrainOnWhat.LAST_ASSISTANT_MESSAGE

# Train on everything (including user messages)
TrainOnWhat.ALL_TOKENS

# Other options
TrainOnWhat.LAST_ASSISTANT_TURN
TrainOnWhat.ALL_MESSAGES
TrainOnWhat.ALL_USER_AND_SYSTEM_MESSAGES
TrainOnWhat.CUSTOMIZED  # Set trainable=True/False on individual messages

Vision inputs

For VLM models, use ImageChunk in messages:

message = {
    "role": "user",
    "content": [
        {"type": "image", "image_url": "https://..."},  # or local path
        {"type": "text", "text": "What is in this image?"},
    ],
}

See docs/rendering.mdx and tinker_cookbook/recipes/vlm_classifier/train.py for VLM examples.

Custom renderers

Register a custom renderer:

from tinker_cookbook.renderers import register_renderer

def my_renderer_factory(tokenizer, image_processor):
    return MyCustomRenderer(tokenizer)

register_renderer("my_renderer", my_renderer_factory)

Picklability

Renderers must be pickleable for distributed rollout execution. The codebase tests this — see tinker_cookbook/renderers/renderer_pickle_test.py.

Common pitfalls

  • Always use model_info.get_recommended_renderer_name() — renderer must match model family
  • After loading a checkpoint trained with a specific renderer, use the same renderer name
  • build_supervised_example() returns weights as list[float] — wrap with TensorData.from_numpy() if needed
  • For tool calling, use create_conversation_prefix_with_tools() to inject tool definitions

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Guide for checkpointing — saving, loading, and resuming training with CheckpointRecord. Use when the user asks about saving weights, resuming training, checkpoint management, or the checkpoint lifecycle.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

uiuc-kang-lab/rlvr_generalization_bounds52026년 5월 13일 업데이트

ci

무료

Guide for testing conventions and CI pipelines — unit tests, integration smoke tests, pytest markers, and GitHub Actions workflows. Use when the user asks about testing, CI, running tests, or adding tests for a recipe.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

uiuc-kang-lab/rlvr_generalization_bounds52026년 5월 13일 업데이트

Guide for using completers — TokenCompleter and MessageCompleter for text generation during RL rollouts and evaluation. Use when the user asks about generating text, completing messages, or using completers in RL environments.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

uiuc-kang-lab/rlvr_generalization_bounds52026년 5월 13일 업데이트

Guide for contributing to the tinker-cookbook repo — development setup, code style, type checking, PR process, and design conventions. Use when the user asks about how to contribute, set up the dev environment, code style, or project conventions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

uiuc-kang-lab/rlvr_generalization_bounds52026년 5월 13일 업데이트

datasets

무료

Guide for dataset construction — SupervisedDatasetBuilder, RLDatasetBuilder, ChatDatasetBuilder, and custom dataset creation from JSONL, HuggingFace, or conversation data. Use when the user asks about datasets, data loading, data preparation, or custom data formats.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

uiuc-kang-lab/rlvr_generalization_bounds52026년 5월 13일 업데이트

Set up and run knowledge distillation (on-policy, off-policy, or multi-teacher) from a teacher model to a student model using the Tinker API. Use when the user wants to distill knowledge, compress models, or train a student from a teacher.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

uiuc-kang-lab/rlvr_generalization_bounds52026년 5월 13일 업데이트

uiuc-kang-lab의 스킬 모두 보기

이 스킬의 문제 신고