Instructions to use artindnr/gpt-oss-20b-multilingual-thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use artindnr/gpt-oss-20b-multilingual-thinking with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("openai/gpt-oss-20b") model = PeftModel.from_pretrained(base_model, "artindnr/gpt-oss-20b-multilingual-thinking") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use artindnr/gpt-oss-20b-multilingual-thinking with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for artindnr/gpt-oss-20b-multilingual-thinking to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for artindnr/gpt-oss-20b-multilingual-thinking to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for artindnr/gpt-oss-20b-multilingual-thinking to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="artindnr/gpt-oss-20b-multilingual-thinking", max_seq_length=2048, )
gpt-oss-20b — Multilingual Reasoning LoRA
LoRA adapter for openai/gpt-oss-20b, fine-tuned to strengthen multilingual chain-of-thought reasoning across English, Spanish, French, Italian, and German.
- Developed by: Artin Daneshvar
- Base model:
openai/gpt-oss-20b - Adapter type: LoRA (PEFT)
- Fine-tuning task: Causal language modeling / reasoning
- Language(s): English, Spanish, French, Italian, German
- License: MIT (adapter weights only — the base model itself is Apache-2.0, see
openai/gpt-oss-20b)
Model Details
This is a LoRA adapter only — it is not a merged/standalone model. You need the base openai/gpt-oss-20b weights plus this adapter to run it. The repo contains:
adapter_config.jsonadapter_model.safetensors
Training Data
Fine-tuned on HuggingFaceH4/Multilingual-Thinking, a reasoning dataset built by sampling 1k training examples from the SystemChat subset of SmolTalk2 and translating the chain-of-thought traces into Spanish, French, Italian, and German using another language model. The English reasoning traces are also retained, so the model sees the same underlying reasoning task expressed across five languages.
This setup is intended to encourage the model to produce coherent step-by-step reasoning regardless of the input/output language, rather than reasoning only in English and translating the final answer.
Training Procedure
- Hardware: 1x NVIDIA H100 80GB
- Method: LoRA (Low-Rank Adaptation) via PEFT
0.19.1
LoRA Configuration
| Parameter | Value |
|---|---|
r (rank) |
8 |
lora_alpha |
16 |
lora_dropout |
0.0 |
bias |
none |
target_modules |
q_proj, k_proj, v_proj, o_proj |
target_parameters |
MoE expert layers: gate_up_proj, down_proj on layers 7, 15, and 23 |
The adapter targets both the standard attention projections and a subset of the mixture-of-experts (MoE) expert weights at layers 7, 15, and 23 — chosen to adapt reasoning-relevant expert pathways at early, middle, and late points in the network without fine-tuning all experts.
How to Get Started with the Model
Option 1: 🤗 Transformers + PEFT
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model_id = "openai/gpt-oss-20b"
adapter_id = "artindnr/gpt-oss-20b-multilingual-thinking"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
messages = [
{"role": "user", "content": "Explique el teorema de Pitágoras paso a paso."}
]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Option 2: Unsloth
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "artindnr/gpt-oss-20b-multilingual-thinking",
max_seq_length = 1024,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "user", "content": "Explique el teorema de Pitágoras paso a paso."}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt = True,
return_tensors = "pt",
return_dict = True,
).to("cuda")
from transformers import TextStreamer
_ = model.generate(**inputs, max_new_tokens = 512, streamer = TextStreamer(tokenizer))
Note: this adapter was trained with plain PEFT (not Unsloth's trainer), using PEFT's
target_parametersfeature to target specific MoE expert layers directly. Loading through Unsloth should work since it loads adapters via standard PEFT under the hood, but the PEFT/Transformers path above is the one this card's usage was verified against — if you hit a loading issue with Unsloth, fall back to Option 1.
Intended Use
This adapter is intended for research and experimentation on multilingual reasoning in LLMs. It is not evaluated for production or safety-critical use cases.
Limitations
- Trained on a relatively small sample (1k examples), so gains may be narrow or task-specific rather than broadly generalized.
- Reasoning traces in the training data were themselves machine-translated, which may introduce translation artifacts into the model's non-English reasoning style.
- Only 4 non-English languages are covered; performance on other languages is untested.
Citation
If you use this adapter, please also credit the base model and dataset:
@misc{gpt-oss-20b,
title = {gpt-oss-20b},
author = {OpenAI},
howpublished = {\url{https://huggingface.co/openai/gpt-oss-20b}}
}
@misc{multilingual-thinking,
title = {Multilingual-Thinking},
author = {HuggingFaceH4},
howpublished = {\url{https://huggingface.co/datasets/HuggingFaceH4/Multilingual-Thinking}}
}
Author
Fine-tuned and maintained by Artin Daneshvar GitHub: github.com/Artin200912
- Downloads last month
- 98
Model tree for artindnr/gpt-oss-20b-multilingual-thinking
Base model
openai/gpt-oss-20b