msingh-psl Poojanbuselvan commited on
Commit
dced854
·
1 Parent(s): d3b3e78

pushing dataset (#1)

Browse files

- pushing dataset (acc5877f0e9c523f8970460a1f19e511c31e439c)


Co-authored-by: Pooja Anbuselvan <Poojanbuselvan@users.noreply.huggingface.co>

Files changed (6) hide show
  1. .gitattributes +2 -0
  2. ATTRIBUTION.csv +0 -0
  3. LICENSE +42 -0
  4. README.md +291 -1
  5. data/train.jsonl +3 -0
  6. data/validation.jsonl +3 -0
.gitattributes CHANGED
@@ -58,3 +58,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ data/train.jsonl filter=lfs diff=lfs merge=lfs -text
62
+ data/validation.jsonl filter=lfs diff=lfs merge=lfs -text
ATTRIBUTION.csv ADDED
The diff for this file is too large to render. See raw diff
 
LICENSE ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ terraform-multicloud
2
+ Copyright (c) 2026 SASVA AI Model Cognition Labs (MCL) Team
3
+
4
+ This DATASET — the compilation, the model-written `instruction` and `input`
5
+ fields, the provenance columns and ATTRIBUTION.csv — is licensed under the
6
+ Creative Commons Attribution 4.0 International Licence (CC-BY-4.0).
7
+
8
+ https://creativecommons.org/licenses/by/4.0/legalcode
9
+
10
+ CC-BY-4.0 is inherited from the upstream source, which must be attributed:
11
+
12
+ TerraDS: A Dataset for Terraform HCL Programs
13
+ Zenodo, doi:10.5281/zenodo.20339474 (CC-BY-4.0)
14
+
15
+ ------------------------------------------------------------------------------
16
+ THE CODE INSIDE REMAINS UNDER ITS ORIGINAL LICENCES
17
+ ------------------------------------------------------------------------------
18
+
19
+ The `output` field of every row is a Terraform source file written by a third
20
+ party and redistributed here unaltered. It is NOT covered by the licence above.
21
+ Each row carries the `repo`, `license` and `file_path` of its origin, and
22
+ ATTRIBUTION.csv lists all 25,264 source repositories with their SPDX licence.
23
+
24
+ Row counts by source licence:
25
+
26
+ MIT 49,211 BSD-2-Clause 277
27
+ Apache-2.0 24,750 WTFPL 141
28
+ UPL-1.0 1,222 ISC 97
29
+ Unlicense 937 0BSD 8
30
+ MIT-0 904 BSD-3-Clause-Clear 1
31
+ BSD-3-Clause 892
32
+ CC0-1.0 472
33
+
34
+ 76,450 rows (96.9%) are under licences requiring attribution and retention of
35
+ the licence text. If you redistribute this dataset or a derivative, carry
36
+ ATTRIBUTION.csv with it.
37
+
38
+ Apache-2.0 section 4(b) requires retention of NOTICE files. Repository-root
39
+ NOTICE files are NOT included here: the extraction unit is a single .tf file.
40
+ ATTRIBUTION.csv plus the `repo` column is the route back to them.
41
+
42
+ Removal requests: open a discussion on this dataset naming the repository.
README.md CHANGED
@@ -1,3 +1,293 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - text-generation
5
+ language:
6
+ - en
7
+ - code
8
+ tags:
9
+ - terraform
10
+ - hcl
11
+ - infrastructure-as-code
12
+ - iac
13
+ - code-generation
14
+ - devops
15
+ - aws
16
+ - azure
17
+ - gcp
18
+ - kubernetes
19
+ - synthetic-instructions
20
+ size_categories:
21
+ - 10K<n<100K
22
+ pretty_name: Terraform Multicloud
23
+ source_datasets:
24
+ - extended|terrads
25
+ configs:
26
+ - config_name: default
27
+ data_files:
28
+ - split: train
29
+ path: data/train.jsonl
30
+ - split: validation
31
+ path: data/validation.jsonl
32
  ---
33
+
34
+ # terraform-multicloud
35
+
36
+ **78,912 natural-language → Terraform (HCL) pairs**, drawn from 25,264 public
37
+ GitHub repositories across 15 provider families. Every target is human-written
38
+ HCL that passes `terraform validate`. Every row carries its source repository,
39
+ licence and file path.
40
+
41
+ Built by the **SASVA AI Model Cognition Labs (MCL) Team** and used to train
42
+ [`SASVAAI/qwen38-27b-terraform`](https://huggingface.co/SASVAAI/qwen38-27b-terraform).
43
+
44
+ ## What one row looks like
45
+
46
+ One complete row from `data/train.jsonl`, reproduced in full with nothing
47
+ elided:
48
+
49
+ ```json
50
+ {
51
+ "instruction": "Write a Terraform configuration for AWS that satisfies the requirement below. Emit only HCL — no explanation, no markdown fences.",
52
+ "input": "Create a VPC with a CIDR block specified by the `vpc_cidr` variable, enable IPv6 assignment, and ensure DNS support and DNS hostnames are both enabled; tag the VPC with the project name provided via the `project_name` variable.",
53
+ "output": "\n# Create a VPC to launch our instances into\nresource \"aws_vpc\" \"kubernetes\" {\n assign_generated_ipv6_cidr_block = true\n cidr_block = var.vpc_cidr\n\n # ENPOINT fix\n enable_dns_support = true\n enable_dns_hostnames = true\n\n \n\n tags = {\n Name = \"${var.project_name}\"\n }\n}",
54
+ "repo": "dvogt/aws-kube-sandbox",
55
+ "license": "Apache-2.0",
56
+ "file_path": "aws-kube-tf-kubernetes/modules/network/vpc.tf",
57
+ "provider_family": "aws",
58
+ "resource_types": [
59
+ "aws_vpc"
60
+ ],
61
+ "signature": "fa677c3c8d1c83372b1079db5d480539"
62
+ }
63
+ ```
64
+
65
+ The `output` field above is a single JSON string; rendered, it is the file
66
+ exactly as its author committed it:
67
+
68
+ ```hcl
69
+
70
+ # Create a VPC to launch our instances into
71
+ resource "aws_vpc" "kubernetes" {
72
+ assign_generated_ipv6_cidr_block = true
73
+ cidr_block = var.vpc_cidr
74
+
75
+ # ENPOINT fix
76
+ enable_dns_support = true
77
+ enable_dns_hostnames = true
78
+
79
+
80
+
81
+ tags = {
82
+ Name = "${var.project_name}"
83
+ }
84
+ }
85
+ ```
86
+
87
+ | Field | Type | Meaning |
88
+ |---|---|---|
89
+ | `instruction` | string | The task directive. Names the provider family, forbids prose. |
90
+ | `input` | string | Plain-language description of the infrastructure wanted. |
91
+ | `output` | string | The target `.tf` file, verbatim as its author wrote it. |
92
+ | `repo` | string | Source repository, `owner/name`. **Attribution.** |
93
+ | `license` | string | That repository's SPDX licence id. |
94
+ | `file_path` | string | Path of the file within the repository. |
95
+ | `provider_family` | string | Build lane the row came from (one of 15, below). |
96
+ | `resource_types` | list[string] | Terraform resource types declared in the output. |
97
+ | `signature` | string | Order-insensitive hash of the declared resources. Dedup and contamination key. |
98
+
99
+ **`output` is human-written. `instruction` and `input` are model-written** — see
100
+ [Provenance](#provenance).
101
+
102
+ ## Statistics
103
+
104
+ | | train | validation | total |
105
+ |---|---|---|---|
106
+ | Rows | 74,909 | 4,003 | **78,912** |
107
+ | Size on disk | 241,099,954 B | 12,705,591 B | 253,805,545 B |
108
+ | Distinct source repos | 23,806 | 1,458 | **25,264** |
109
+ | Repo overlap | — | — | **0** |
110
+ | Distinct resource types | 4,784 | 1,354 | 4,841 |
111
+ | Tokens (Qwen3.8 tokenizer) | 54,233,060 | 2,847,868 | **57,080,928** |
112
+ | Tokens: median / p90 / p99 / max | 501 / 1,486 / 3,739 / 8,490 | 504 / 1,421 / 3,466 / 7,166 | |
113
+ | `output` chars: median / p90 / max | 1,329 / 4,806 / 27,910 | 1,346 / 4,714 / 27,724 | |
114
+
115
+ ### Provider families
116
+
117
+ `provider_family` is the **build lane** — the extraction pass a row came from —
118
+ not a parse of the instruction text. The two can disagree for cross-cutting
119
+ configs (an EKS module is built in the `k8s` lane but its instruction says AWS).
120
+
121
+ | Family | Train | Val | | Family | Train | Val |
122
+ |---|---|---|---|---|---|---|
123
+ | `aws` | 45,123 | 2,337 | | `ibm` | 710 | 45 |
124
+ | `gcp` | 8,610 | 492 | | `yandex` | 686 | 36 |
125
+ | `azure` | 8,546 | 468 | | `vault` | 576 | 19 |
126
+ | `k8s` | 4,330 | 298 | | `docker` | 458 | 24 |
127
+ | `oci` | 2,111 | 117 | | `openstack` | 362 | 19 |
128
+ | `alicloud` | 1,274 | 46 | | `vsphere` | 283 | 17 |
129
+ | `github` | 869 | 42 | | `cloudflare` | 210 | 8 |
130
+ | `digitalocean` | 761 | 35 | | | | |
131
+
132
+ **The corpus is AWS-heavy** — roughly 60% of rows, about 3:2 against every other
133
+ family combined.
134
+
135
+ ## How it was built
136
+
137
+ ```
138
+ TerraDS archive → extract → verify → dedup → back-translate → seal → split
139
+ ```
140
+
141
+ 1. **Extract.** Candidate module directories pulled from the TerraDS archive
142
+ (Zenodo [10.5281/zenodo.20339474](https://doi.org/10.5281/zenodo.20339474)),
143
+ filtered to a 15-licence permissive allowlist.
144
+ 2. **Verify.** `terraform init -backend=false` + `terraform validate` at the
145
+ **module-directory** level, against a one-version offline provider mirror.
146
+ Terraform resolves references across every `.tf` file in a directory, so the
147
+ directory is the only thing that can be validated — but a *training pair* is
148
+ one resource-bearing `.tf` file. Files without a `resource` block
149
+ (`variables.tf`, `outputs.tf`, `versions.tf`) are kept as sibling context and
150
+ never become pairs.
151
+ 3. **Dedup.** By `signature`, an **order-insensitive** hash over `resource` and
152
+ `data` blocks. HCL is declarative: the same resources in a different order are
153
+ the same config. Scoped to resource/data blocks only — including
154
+ `provider`/`terraform` scaffolding made the contamination seal nearly inert.
155
+ 4. **Back-translate.** A teacher model reads the HCL and writes the
156
+ plain-language description. Runs *after* dedup, so the teacher is never paid
157
+ for rows about to be discarded.
158
+ 5. **Seal.** Rows whose `signature` collides with an
159
+ [IaC-Eval](https://huggingface.co/datasets/autoiac-project/iac-eval) reference
160
+ configuration are removed, so a model trained here can still be scored on that
161
+ benchmark honestly.
162
+ 6. **Split.** Grouped by **repository**, never by row.
163
+
164
+ ### Split discipline
165
+
166
+ The split is **repo-disjoint and verified**: 0 of 25,264 repositories appear on
167
+ both sides. This matters more than usual here. The corpus has a high near-
168
+ duplicate rate between repositories that copied each other's modules, so a
169
+ row-level split would put near-identical configs on both sides and turn any eval
170
+ loss into a recall measurement.
171
+
172
+ Per-family splits were merged with a resolver rather than concatenated: 5.8% of
173
+ repositories appear in more than one family lane, and independent per-family
174
+ splits put 42 repositories train-side in one file and val-side in another. The
175
+ resolver drops the train-side rows and keeps validation — never the reverse,
176
+ because shrinking validation changes the eval set and losses are not comparable
177
+ across eval-set sizes.
178
+
179
+ ## Provenance
180
+
181
+ **The HCL is human-written and unaltered.** Each `output` is the source file
182
+ exactly as its author committed it. The verification stage rewrites dead syntax
183
+ (stale version pins, 0.11-era type constraints) only inside a throwaway work
184
+ directory so that `terraform init` can run offline; those rewrites are discarded
185
+ and the candidate's original text is what ships.
186
+
187
+ **The instructions are model-written.** `instruction` and `input` were
188
+ back-translated from the HCL by a teacher model — the model read the answer and
189
+ wrote a description of it.
190
+
191
+ **Teacher model.** `Qwen/Qwen3-Coder-Next`.
192
+
193
+ ## Licensing
194
+
195
+ **This dataset is released under CC-BY-4.0**, inherited from TerraDS, its
196
+ upstream source.
197
+
198
+ **The code inside remains under its original licences.** Every row carries
199
+ `repo`, `license` and `file_path`, and [`ATTRIBUTION.csv`](./ATTRIBUTION.csv)
200
+ lists all 25,264 source repositories with their licence and row count, so
201
+ attribution is possible per-row and in bulk.
202
+
203
+ Source repositories were filtered to a permissive allowlist **before**
204
+ extraction, so unlike a header-based label this is a repository-level licence:
205
+
206
+ | Licence | Rows | Share |
207
+ |---|---|---|
208
+ | MIT | 49,211 | 62.36% |
209
+ | Apache-2.0 | 24,750 | 31.36% |
210
+ | UPL-1.0 | 1,222 | 1.55% |
211
+ | Unlicense | 937 | 1.19% |
212
+ | MIT-0 | 904 | 1.15% |
213
+ | BSD-3-Clause | 892 | 1.13% |
214
+ | CC0-1.0 | 472 | 0.60% |
215
+ | BSD-2-Clause | 277 | 0.35% |
216
+ | WTFPL | 141 | 0.18% |
217
+ | ISC | 97 | 0.12% |
218
+ | 0BSD | 8 | 0.01% |
219
+ | BSD-3-Clause-Clear | 1 | 0.00% |
220
+
221
+ **76,450 rows (96.9%) are under licences that require attribution and retention
222
+ of the licence text.** If you redistribute this dataset or a derivative of it,
223
+ carry `ATTRIBUTION.csv` with it. If you redistribute generated HCL, note that
224
+ MIT and Apache-2.0 obligations attach to the *training material*, not
225
+ automatically to model output — but the two are close enough here that the
226
+ conservative reading is the safe one.
227
+
228
+ Apache-2.0 §4(b) requires retention of `NOTICE` files. Those files are **not**
229
+ carried in this dataset: the unit is a single `.tf` file, and repository-root
230
+ `NOTICE` files were outside the extraction. `ATTRIBUTION.csv` plus `repo` is the
231
+ route back to them.
232
+
233
+ ### Removal requests
234
+
235
+ If your repository appears in `ATTRIBUTION.csv` and you want it removed, open a
236
+ discussion on this dataset. Removals are applied by `repo` across both splits and
237
+ the file is regenerated.
238
+
239
+ ## Intended use
240
+
241
+ **Supervised fine-tuning for natural-language → Terraform generation.** The
242
+ training rendering used for the reference model is:
243
+
244
+ ````text
245
+ <|im_start|>system
246
+ {SYSTEM}<|im_end|>
247
+ <|im_start|>user
248
+ {instruction}
249
+
250
+ ```
251
+ {input}
252
+ ```<|im_end|>
253
+ <|im_start|>assistant
254
+ {output}<|im_end|>
255
+ ````
256
+
257
+ The user turn's payload is **fenced**. The reference model additionally trained
258
+ with an empty `<think></think>` block before the answer.
259
+
260
+ ```python
261
+ from datasets import load_dataset
262
+ ds = load_dataset("SASVAAI/terraform-multicloud") # train: 74,909 · validation: 4,003
263
+ aws = ds["train"].filter(lambda r: r["provider_family"] == "aws")
264
+ ```
265
+
266
+ **Out of scope.** This is not a benchmark. The validation split is a held-out
267
+ sample of the same distribution, scored by loss; it has no execution harness, no
268
+ Rego policies and no pass/fail oracle. For scored evaluation use IaC-Eval, which
269
+ this corpus is deliberately disjoint from.
270
+
271
+ ## Citation
272
+
273
+ ```bibtex
274
+ @misc{terraform_multicloud_2026,
275
+ title = {terraform-multicloud: Natural-language to Terraform pairs from permissively licensed repositories},
276
+ author = {{SASVA AI Model Cognition Labs (MCL) Team}},
277
+ year = {2026},
278
+ url = {https://huggingface.co/datasets/SASVAAI/terraform-multicloud}
279
+ }
280
+
281
+ @dataset{terrads,
282
+ title = {TerraDS: A Dataset for Terraform HCL Programs},
283
+ year = {2025},
284
+ publisher = {Zenodo},
285
+ doi = {10.5281/zenodo.20339474}
286
+ }
287
+
288
+ @inproceedings{iaceval2024,
289
+ title = {IaC-Eval: A Code Generation Benchmark for Infrastructure-as-Code Programs},
290
+ booktitle = {NeurIPS Datasets and Benchmarks},
291
+ year = {2024}
292
+ }
293
+ ```
data/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:229db17145be4d90bac2f10dd947d8e6e26cef15695e5aac008466f62a9161da
3
+ size 241099954
data/validation.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5cf504d10033da05aed2c157a89b76f1101fc725cce9962997c8509740e90e0
3
+ size 12705591