Model Details
This is a LoRA adapter only — it is not a merged/standalone model. You need the base gpt-oss-20b weights plus this adapter to run it. The repo contains:
adapter_config.json
adapter_model.safetensors
Training Data
HuggingFaceH4/Multilingual-Thinking — reasoning chain-of-thought examples originally in English, translated into French, German, Spanish, and Italian. This is the same dataset used in OpenAI's gpt-oss fine-tuning cookbook.
Training Procedure
- Loaded
unsloth/gpt-oss-20b in 4-bit with FastLanguageModel, max_seq_length = 1024
- LoRA applied to
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (including MoE expert projections)
- Trained only on assistant responses via Unsloth's
train_on_responses_only (loss masked on user turns)
Table with columns: Hyperparameter, Value| Hyperparameter | Value |
|---|
| LoRA rank (r) | 8 |
| LoRA alpha | 16 |
| LoRA dropout | 0 |
| Gradient checkpointing | unsloth |
| Batch size (per device) | 1 |
| Gradient accumulation | 4 |
| Learning rate | 2e-4 |
| LR scheduler | linear |
| Warmup steps |
Note: This run used max_steps = 30 as a short demonstration run, not a full epoch over the dataset. Treat this checkpoint as a proof-of-concept rather than a fully converged fine-tune — expect a num_train_epochs = 1 (or more) run to give noticeably stronger results.
How to Get Started with the Model
Option 1: Unsloth (recommended, fastest)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "artindnr/gpt-oss-20b-multilingual-unsloth",
max_seq_length = 1024,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "system", "content": "reasoning language: French\n\nYou are a helpful assistant that can solve mathematical problems."},
{"role": "user", "content": "Solve x^5 + 3x^4 - 10 = 3."},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt = True,
return_tensors = "pt",
return_dict = True,
reasoning_effort = "medium",
).to("cuda")
from transformers import TextStreamer
_ = model.generate(**inputs, max_new_tokens = 256, streamer = TextStreamer(tokenizer))
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model_id = "unsloth/gpt-oss-20b"
adapter_id = "artindnr/gpt-oss-20b-multilingual-unsloth"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
device_map = "auto",
torch_dtype = torch.bfloat16,
load_in_4bit = True,
)
model = PeftModel.from_pretrained(base_model, adapter_id)
messages = [
{"role": "system", "content": "reasoning language: German\n\nYou are a helpful assistant."},
{"role": "user", "content": "Explain how photosynthesis works."},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt = True,
return_tensors = "pt",
return_dict = True,
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens = 256)
print(tokenizer.decode(outputs[0], skip_special_tokens = True))
Set the reasoning language line in the system prompt to English, French, German, Spanish, or Italian to steer which language the model's internal reasoning is produced in.
Limitations
- This adapter was trained for a small number of steps (30) as a demo run — reasoning-language adherence and output quality may be inconsistent. Consider training for more steps/epochs for production use.
- Inherits all limitations and biases of the base
gpt-oss-20b model.
- Only tested with Unsloth's loading path at time of writing; GGUF/vLLM export for gpt-oss LoRA adapters was not yet supported by Unsloth when this was trained.
Framework versions
unsloth
trl == 0.22.2
transformers == 4.56.2
peft
Trained with Unsloth and Hugging Face's TRL library.