1from unsloth import FastLanguageModel
2
3# 1. Load the model and tokenizer
4model, tokenizer = FastLanguageModel.from_pretrained(
5 model_name = "your-username/Koa-AI-v1",
6 max_seq_length = 2048,
7 load_in_4bit = True,
8)
9FastLanguageModel.for_inference(model)
10
11# 2. Define prompt using ChatML template
12messages = [
13 {"role": "system", "content": "You are Koa AI v1, an expert coding agent."},
14 {"role": "user", "content": "Write a Python script to monitor GPU VRAM usage."},
15]
16
17inputs = tokenizer.apply_chat_template(
18 messages,
19 tokenize = True,
20 add_generation_prompt = True,
21 return_tensors = "pt"
22).to("cuda")
23
24# 3. Generate response
25outputs = model.generate(input_ids = inputs, max_new_tokens = 512, use_cache = True)
26print(tokenizer.decode(outputs[0]))
This qwen3_5 model was trained 2x faster with
Unsloth and Huggingface's TRL library.