Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
conversation_id
stringlengths
32
32
id
stringlengths
37
37
messages
listlengths
3
101
metadata
unknown
supervised_message_indices
listlengths
1
50
tools
stringclasses
2 values
ed902a37527cffc69648097791b690be
ed902a37527cffc69648097791b690be-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 1434, "generated_responses": 1, "generation_status": "completed", "original_conversation_id": "63d4a111f15734810ac2994d0e9e182c017ecbab3c1ad6b1b8146f98237daa23:90760", "original_global_index": 90760, "response_tokens": 393, "segment_end_reason": "finished", "segment_index": 0, "segmen...
[ 2 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
2e0393ca55fd161aeb6e68c0a98edfeb
2e0393ca55fd161aeb6e68c0a98edfeb-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 1498, "generated_responses": 1, "generation_status": "completed", "original_conversation_id": "069cc2f2673425665c012668d0e6b201e331a683167e6614c263be3892d84031:677501", "original_global_index": 677501, "response_tokens": 500, "segment_end_reason": "finished", "segment_index": 0, "segm...
[ 2 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
b4d218f48791766f14e8cc042780d3ba
b4d218f48791766f14e8cc042780d3ba-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 1604, "generated_responses": 1, "generation_status": "completed", "original_conversation_id": "069cc2f2673425665c012668d0e6b201e331a683167e6614c263be3892d84031:519883", "original_global_index": 519883, "response_tokens": 570, "segment_end_reason": "finished", "segment_index": 0, "segm...
[ 2 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
6cfb9c781562ea70009d5353e3587593
6cfb9c781562ea70009d5353e3587593-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 4173, "generated_responses": 3, "generation_status": "completed", "original_conversation_id": "63d4a111f15734810ac2994d0e9e182c017ecbab3c1ad6b1b8146f98237daa23:84353", "original_global_index": 84353, "response_tokens": 3111, "segment_end_reason": "finished", "segment_index": 0, "segme...
[ 2, 4, 6 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
21ff0819fa53b1fab25bb90810f5deb9
21ff0819fa53b1fab25bb90810f5deb9-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 9739, "generated_responses": 5, "generation_status": "completed", "original_conversation_id": "daeb251bf400dcb2c3e9d9229fe4d75df47eb941f291d4c81ecd10199b23b0df:260961", "original_global_index": 260961, "response_tokens": 7115, "segment_end_reason": "finished", "segment_index": 0, "seg...
[ 2, 4, 6, 8, 10 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
5c8a5722d7486933ffcf126c1279a3e0
5c8a5722d7486933ffcf126c1279a3e0-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 1211, "generated_responses": 1, "generation_status": "completed", "original_conversation_id": "2743b8486e0e983d9afafd00cddd0a94d2bdf6757dde66d603e908dec0098499:422208", "original_global_index": 422208, "response_tokens": 191, "segment_end_reason": "finished", "segment_index": 0, "segm...
[ 2 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
ed228ecfa2d24b33ec0e0403b86b583b
ed228ecfa2d24b33ec0e0403b86b583b-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 2593, "generated_responses": 3, "generation_status": "completed", "original_conversation_id": "63d4a111f15734810ac2994d0e9e182c017ecbab3c1ad6b1b8146f98237daa23:85383", "original_global_index": 85383, "response_tokens": 1479, "segment_end_reason": "finished", "segment_index": 0, "segme...
[ 2, 4, 6 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
4d87dc12b0e3d4ee0b77431e14cc1d3a
4d87dc12b0e3d4ee0b77431e14cc1d3a-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 3598, "generated_responses": 3, "generation_status": "completed", "original_conversation_id": "5fc6b8d1bbe43513e7e7c52eda1cd32c3e23adda0e6708108a775d416e38d845:76981", "original_global_index": 76981, "response_tokens": 2484, "segment_end_reason": "finished", "segment_index": 0, "segme...
[ 2, 4, 6 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
47e81e1470868a0a524eb8f8ce1f2b8e
47e81e1470868a0a524eb8f8ce1f2b8e-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 12542, "generated_responses": 6, "generation_status": "ambiguous", "original_conversation_id": "2743b8486e0e983d9afafd00cddd0a94d2bdf6757dde66d603e908dec0098499:313266", "original_global_index": 313266, "response_tokens": 10340, "segment_end_reason": "finished", "segment_index": 0, "s...
[ 2, 4, 6, 8, 10, 12 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
6676feb3f13ad227f5a4820a7a92db08
6676feb3f13ad227f5a4820a7a92db08-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 1234, "generated_responses": 1, "generation_status": "completed", "original_conversation_id": "daeb251bf400dcb2c3e9d9229fe4d75df47eb941f291d4c81ecd10199b23b0df:690308", "original_global_index": 690308, "response_tokens": 232, "segment_end_reason": "finished", "segment_index": 0, "segm...
[ 2 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
4306b22c6360e3f93575b13a9a14eb45
4306b22c6360e3f93575b13a9a14eb45-0000
[ { "content": "You are a general-purpose assistant with access to a Linux terminal. Answer clearly and concisely unless the user asks for more detail.\n\nUse the terminal when it is necessary or when running commands would materially improve accuracy, including for calculations, code execution, and working with ...
{ "full_tokens": 12729, "generated_responses": 15, "generation_status": "completed", "original_conversation_id": "069cc2f2673425665c012668d0e6b201e331a683167e6614c263be3892d84031:517673", "original_global_index": 517673, "response_tokens": 11115, "segment_end_reason": "compaction:threshold", "segment_in...
[ 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 ]
[{"function":{"description":"Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Each call times out after 30 seconds.\n","name":"bash","parameters":{"additionalPro...
End of preview. Expand in Data Studio

CapySFT

CapySFT is a dataset for supervised fine tuning of assistants that can reason, answer questions, and use terminal tools. User requests come from Tulu 3 and SmolTalk. New assistant responses were generated with DeepSeek-V4-Flash-0731.

Dataset sizes

Choose 500M, 1B, or 2B supervised response tokens. Token counts use our LLM course's truncated Qwen3.5 tokenizer (32,768 base tokens plus 33 special tokens), included under tokenizer/. Counts vary with the tokenizer and chat formatting.

Configuration Source conversations Training records Supervised response tokens Files
500M 199,455 217,998 500,024,135 first 1
1B (default) 399,746 436,342 1,000,019,252 first 2
2B 785,488 862,479 1,999,896,726 all 4

The configurations share four compressed JSONL files, each with approximately 500 million supervised response tokens. Smaller configurations are subsets of the larger ones. Related records from the same source conversation stay in one file. Each configuration contains only a train split.

One record is a complete training segment. Long source conversations can produce several records when their history is summarized and generation continues. Retained segments are not truncated and fit within 16,384 tokens. Supervised counts include selected assistant reasoning, answers, tool calls, summaries, and the end marker of each selected message. Context messages and tool results do not contribute to these counts.

Load with Hugging Face

Use the standard datasets interface:

from datasets import load_dataset

data = load_dataset("vfleaking/capysft", "1B", split="train", token=True)
example = data[0]
print(example["messages"])
print(example["supervised_message_indices"])

Change "1B" to "500M" or "2B" to choose a size. Add streaming=True to iterate without building a complete local Arrow cache. While the repository is private, log in with an account that has access.

Record format

The three fields needed for training are:

Field Type Meaning
messages list of message dictionaries All messages in conversation order, including those used only as context.
tools JSON string or null Available tool definitions. Decode with json.loads before applying a chat template.
supervised_message_indices list of integers Indices into messages identifying assistant messages to supervise.

Messages have role and content, and may have reasoning_content, tool_calls, or tool_call_id. Each tool call has id, type, and function. Its function.arguments field is a JSON string. Missing optional message fields load as None. Remove only those null fields, preserving empty strings and lists:

import copy
import json

messages = [
    {key: value for key, value in message.items() if value is not None}
    for message in copy.deepcopy(example["messages"])
]
for message in messages:
    for call in message.get("tool_calls", []):
        call["function"]["arguments"] = json.loads(call["function"]["arguments"])
tools = json.loads(example["tools"]) if example["tools"] is not None else None

Each row also has id, a unique record identifier, and conversation_id, shared by records from the same source conversation. Group by conversation_id when making a validation split to keep related records together.

The metadata dictionary retains source, generation, segmentation, and token statistics:

Metadata field Meaning
source Prompt mixture: tulu3 or smoltalk.
subset Original subset label within the mixture.
original_global_index Source conversation's index in the prepared prompt collection.
original_conversation_id Original generation identifier, retained for tracing a record to its source.
generation_status Recorded generation outcome. Completed segments are retained even when later generation did not complete.
segment_index Segment order within the source conversation.
segment_type initial, compaction (summary generation), or continuation (generation after a summary).
segment_end_reason Recorded reason this segment ended.
generated_responses Number of newly generated assistant messages; equals the length of supervised_message_indices.
response_tokens Number of supervised response tokens.
full_tokens Number of input tokens, including context and the final message's end marker.

Other source metadata, when present, is also retained.

Tokenization and supervision

The supplied chat template preserves reasoning on every assistant turn. After preparing messages and tools as above, render and tokenize with:

from huggingface_hub import snapshot_download
from transformers import AutoTokenizer

snapshot = snapshot_download(
    "vfleaking/capysft", repo_type="dataset", allow_patterns="tokenizer/*", token=True
)
tokenizer = AutoTokenizer.from_pretrained(f"{snapshot}/tokenizer")
text = tokenizer.apply_chat_template(
    messages, tools=tools, tokenize=False, add_generation_prompt=False
)
text = text.removesuffix("\n")
tokens = tokenizer.encode(text, add_special_tokens=False)

Supervise only assistant messages selected by supervised_message_indices. For each selected message, include its opening <think>, reasoning, closing </think>, answer or complete tool call, and closing <|im_end|>. Include newlines within that body. Mask the assistant role header, the newline after its end marker, all other messages, and padding.

Earlier assistant messages can be context only. For example, a generated summary is supervised when first produced, then appears as masked history in a later record. Keep these earlier messages as input.

The final <|im_end|> ends the segment. Remove only the following template newline and do not append another end token. When packing records together, keep attention and target shifting within each record.

How the data was generated

We used a small agent harness developed for our LLM course assignments, which we call MiniCapyCode. It runs the conversation loop between the model and a sandboxed Linux environment. The model may use bash, read, edit, and write tools, receive their results, and continue its response. Tool use is optional.

Generation used thinking enabled, low reasoning effort, temperature=1, and top_p=1. Later user questions could be rewritten in conversation context. When a conversation approached the context limit, the harness could ask the model to summarize its history and continue from that summary. Summary requests and responses are included as separate training records.

The generated responses can contain errors. Some source conversations ended before all turns completed, but their completed training segments are retained. There is no validation or test split, and the data has not been checked for overlap with every benchmark.

Sources and terms

The source prompts come from Tulu 3 SFT Mixture and SmolTalk. Each record retains the source and subset labels in metadata.

Upstream terms differ by subset, and some Tulu 3 subsets restrict commercial use. Regenerating responses does not remove conditions on the source prompts. See LICENSE.md and the upstream dataset cards for licenses, attribution, and terms governing generated outputs. No single permissive license is asserted for the entire mixture.

Downloads last month
35