Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Couldn't reach 'kasuboski/gleam-instruct' on the Hub (ReadTimeout)
Error code:   UnexpectedError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

id
string
source_file_id
string
source_repo_url
string
messages
list
task_type
string
source_language
null
model_used
string
license
string
schema_version
int64
sft_gleam_00001
0918nobita/domu/src/domu/console.gleam
https://github.com/0918nobita/domu
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00002
0918nobita/domu/src/domu/global/console.gleam
https://github.com/0918nobita/domu
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00003
0918nobita/domu/src/domu/internal/iterator_compat.gleam
https://github.com/0918nobita/domu
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00004
0918nobita/domu/src/domu/window.gleam
https://github.com/0918nobita/domu
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00005
0918nobita/domu/test/domu_test/event_target.gleam
https://github.com/0918nobita/domu
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00006
0918nobita/domu/test/happy_dom.gleam
https://github.com/0918nobita/domu
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00007
0918nobita/json_canvas/src/json_canvas/internal/decode/edge.gleam
https://github.com/0918nobita/json_canvas
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00008
0918nobita/json_canvas/src/json_canvas/internal/encode/edge.gleam
https://github.com/0918nobita/json_canvas
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00009
0918nobita/json_canvas/src/json_canvas/internal/generic_node.gleam
https://github.com/0918nobita/json_canvas
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00010
0ngk/kitazith/src/kitazith/component.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00011
0ngk/kitazith/src/kitazith/component/separator.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00012
0ngk/kitazith/src/kitazith/flag.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00013
0ngk/kitazith/src/kitazith/webhook/delete_query.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00014
0ngk/kitazith/test/kitazith/message_formatting/guild_navigation_test.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00015
0ngk/kitazith/test/kitazith/message_formatting/timestamp_test.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00016
0ngk/kitazith/test/kitazith/poll_test.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00017
0ngk/kitazith/test/kitazith/timestamp_test.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00018
0ngk/kitazith/test/kitazith/webhook/delete_query_test.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00019
0ngk/kitazith/test/kitazith/webhook/edit_query_test.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
sft_gleam_00020
0ngk/kitazith/test/kitazith/webhook/get_query_test.gleam
https://github.com/0ngk/kitazith
[ { "role": "system", "content": "You are a helpful Gleam programming assistant.\n\nKey Gleam rules:\n- Float operators use a dot: +. -. *. /. String concatenation uses <>.\n- No return keyword — the last expression is returned. No null or exceptions.\n- Error handling uses Result(success, error) with Ok/Err...
code_gen
null
gpt-oss-120b
Apache-2.0
1
End of preview.

Gleam Instruct

A synthetic instruction-following dataset for fine-tuning language models to become Gleam programming specialists. Contains 14,053 high-quality instruction-response pairs covering code generation, explanation, and completion tasks, all derived from real open-source Gleam code.

Dataset Summary

Metric Value
Total records 14,053
Task types code_gen, explanation, completion
Source files 4,700 unique .gleam files
Source repos 997 GitHub repositories
Format ChatML (system → user → assistant)
Generation model gpt-oss-120b (primary), openai/gpt-oss-120b via OpenRouter, glm-5.1 via Z.ai

By task type

Task Records Description
code_gen 4,667 Write a new Gleam module inspired by a reference snippet
explanation 4,698 Explain a Gleam code snippet in detail
completion 4,688 Complete a partially-truncated Gleam module

Schema

Each record follows standard ChatML format with metadata:

{
  "id": "sft_gleam_00001",
  "source_file_id": "owner/repo/path.gleam",
  "source_repo_url": "https://github.com/owner/repo",
  "messages": [
    {"role": "system", "content": "You are a helpful Gleam programming assistant..."},
    {"role": "user", "content": "<task-specific instruction with source code>"},
    {"role": "assistant", "content": "<model response>"}
  ],
  "task_type": "code_gen",
  "source_language": null,
  "model_used": "gpt-oss-120b",
  "license": "Apache-2.0",
  "schema_version": 1
}

Field descriptions

Field Type Description
id string Unique record identifier
source_file_id string Source file in owner/repo/path.gleam format
source_repo_url string GitHub repository URL for attribution
messages list ChatML conversation (system + user + assistant)
task_type string code_gen, explanation, or completion
source_language null Reserved for translation tasks (future)
model_used string Model that generated the response
license string Dataset license
schema_version int Schema version (currently 1)

Task Type Details

Code Generation (code_gen)

Given a Gleam code snippet as a reference, write a new module that solves a related but different problem. The model is instructed to use idiomatic Gleam: type annotations, pattern matching, Result for errors, and pipe operators.

Explanation (explanation)

Given a Gleam code snippet, provide a detailed explanation covering what each function does, how types are used, and notable patterns or idioms. Explanations are targeted at someone learning Gleam.

Completion (completion)

Given the first ~60% of a Gleam module (truncated at a random line with a // TODO hint), complete the remaining functions to produce a working module with type annotations and idiomatic patterns.

Generation Pipeline

  1. Corpus: 22,581 Gleam source files from 1,528 GitHub repositories (see kasuboski/gleam-code-corpus)
  2. Sampling: 4,700 files sampled with seed=42, filtered to exclude oversized files (>3K input tokens)
  3. Generation: Each file used to generate one instruction-response pair per task type via openai/gpt-oss-120b
  4. Deduplication: Kept latest generation per (file, task_type) — some files were regenerated to fix truncation
  5. Filtering: Removed truncated responses, failed API calls, and 6 degenerate repetitive outputs (unique line ratio < 0.3)
  6. Reconstruction: User messages rebuilt from source code + task templates; assistant messages preserved verbatim

Quality

  • 0% truncation rate on explanation tasks (max_tokens bumped to 8,192)
  • <1% truncation on code_gen (0.6%) and completion (0.2%)
  • 6 degenerate records filtered out (model looping on repeated patterns)
  • All source code from permissive-license repositories

Loading the Dataset

from datasets import load_dataset

ds = load_dataset("kasuboski/gleam-instruct", data_files="train.jsonl")

Or directly with polars:

import polars as pl
df = pl.read_ndjson("gleam-instruct.jsonl")

Training-Time Mixing

This dataset contains only Gleam-focused pairs. For best results during SFT, we recommend mixing with anti-forgetting data at training time:

Source ~Count Purpose
This dataset 14,053 Gleam specialization
HuggingFaceH4/ultrachat_200k ~3,000 General instruction following
nvidia/OpenCodeInstruct ~500 General code skill preservation

A ~30% general data mix prevents catastrophic forgetting when fine-tuning on a narrow domain like Gleam. Adjust ratios based on your base model and use case.

Intended Use

  • Supervised fine-tuning of LLMs for Gleam code generation and understanding
  • Domain adaptation experiments for niche programming languages
  • Instruction tuning research on code-specific tasks

Limitations

  • Responses are synthetically generated and may contain subtle errors or non-idiomatic patterns
  • Code generation tasks use a limited set of 5 instruction templates
  • No syntax validation was performed on generated Gleam code
  • The dataset is English-only
  • Source code is weighted toward popular/maintained repos — may underrepresent edge cases

License

Apache-2.0

Downloads last month
21