File size: 4,247 Bytes
dbebc11
 
 
 
 
 
 
8c0a578
 
aa8b2bc
4a3726a
aa8b2bc
4a3726a
aa8b2bc
 
4a3726a
aa8b2bc
 
 
 
4a3726a
aa8b2bc
4a3726a
aa8b2bc
 
a4d655a
 
aa8b2bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2d4e7cc
 
aa8b2bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b268fc9
 
 
 
aa8b2bc
 
4a3726a
aa8b2bc
 
 
4a3726a
 
b268fc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
---
license: apache-2.0
language:
- en
- code
base_model:
- Qwen/Qwen2.5-Coder-7B
---

# kiro-1.0-7B-XCode

<div align="center">

**kiro-1.0-7B-XCode** β€” a code-focused language model fine-tuned on top of Qwen2.5-Coder-7B,
trained on a mixed dataset of real-world code and instruction pairs.

[![HuggingFace](https://img.shields.io/badge/πŸ€—%20HuggingFace-constructai%2Fkiro--1.0--7B--XCode-yellow)](https://huggingface.co/constructai/kiro-1.0-7B-XCode)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue)](https://opensource.org/licenses/Apache-2.0)
[![Model Size](https://img.shields.io/badge/Parameters-7B-green)](https://huggingface.co/constructai/kiro-1.0-7B-XCode)
[![Base Model](https://img.shields.io/badge/Base-Qwen2.5--Coder--7B-orange)](https://huggingface.co/Qwen/Qwen2.5-Coder-7B)

</div>

---

![kiro logo](https://huggingface.co/constructai/kiro-1.0-7B-XCode/resolve/main/assets/kiroxcode.jpg)

## πŸ“– Overview

**kiro-1.0-7B-XCode** is the first model in the **kiro** series by [constructai](https://huggingface.co/constructai).

This model is specialized for writing, analyzing, and explaining code in Python and JavaScript. It is trained to follow instructions in the `### Instruction β†’ ### Response` format, making it suitable for IDE plugins, coding assistants, and code review tools.

---

## πŸ‹οΈ Training

| Parameter | Value |
|---|---|
| Base model | `Qwen/Qwen2.5-Coder-7B` |
| Method | QLoRA (4-bit, NF4) + LoRA merge |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| Epochs | 1 |
| Learning rate | 2e-4 |
| Scheduler | Cosine |
| Hardware | NVIDIA RTX A5000 24GB |

### Dataset

The model was trained on ~58,000 samples from a mixed dataset:

| Source | Samples | Description |
|---|---|---|
| `bigcode/the-stack` (Python) | 20,000 | Real-world Python code from GitHub |
| `bigcode/the-stack` (JavaScript) | 20,000 | Real-world JavaScript code from GitHub |
| `iamtarun/python_code_instructions_18k_alpaca` | 18,000 | Python instruction-response pairs |

---

## πŸš€ Quick Start

### Installation

```bash
pip install transformers torch accelerate
```

### Inference

```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_name = "constructai/kiro-1.0-7B-XCode"

tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)

prompt = "### Instruction:\nWrite a Python function that checks if a number is prime.\n\n### Response:\n"

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    do_sample=False,
    repetition_penalty=1.3,
    pad_token_id=tokenizer.eos_token_id,
)
response = tokenizer.decode(
    outputs[0][inputs["input_ids"].shape[1]:],
    skip_special_tokens=True
)
print(response)
```

### Prompt Format

```
### Instruction:
{your request}

### Response:
```

With additional context:
```
### Instruction:
{your request}

### Input:
{additional context or code}

### Response:
```

---

## πŸ“Š Example

**Prompt:**
```
### Instruction:
Write a Python function that checks if a number is prime.

### Response:
```

**kiro-1.0 output:**
```python
def is_prime(num):
    for i in range(2, num):
        if (num % i) == 0:
            return False
    return True
```

---

## ⚠️ Limitations

- Trained for 1 epoch β€” may produce repetitions in long outputs (use `repetition_penalty=1.3`)
- Optimized for Python and JavaScript β€” other languages have limited support
- This is v1.0 β€” quality will improve in future releases

---

## πŸ“œ License

This model is released under the **Apache 2.0** license, inherited from the base model Qwen2.5-Coder-7B.

---

## πŸ™ Acknowledgements

- [Qwen Team](https://huggingface.co/Qwen) for the excellent base model
- [BigCode](https://huggingface.co/bigcode) for The Stack dataset
- [Hugging Face](https://huggingface.co) for the infrastructure
---

![logo](https://huggingface.co/constructai/kiro-1.0-7B-XCode/resolve/main/assets/logokiro.jpg)


---

<div align="center">
Made with ❀️ by <a href="https://huggingface.co/constructai">constructai</a>
</div>