Downloads · 30 days
3
3% of all-time downloads
alfinpratama/qwen38-27b-desktop-agent-lora
qwen38-27b-desktop-agent-lora is a text generation model from alfinpratama. Use it when you need the model to write or continue text. It is set up for peft.
LoRA adapter for desktop-agent tool-calling on top of unsloth/Qwen3.8-27B-unsloth-bnb-4bit (4-bit QLoRA). Trains the model to act as an autonomous Linux desktop co-worker: reason, call tools, observe results, recover…
Downloads · 30 days
3
3% of all-time downloads
All-time downloads
103
Public
Repo size
339 MB
Likes
0
Public
Click a slice to open those files.
.safetensors319 MB · 94%
From the Hugging Face model README
LoRA adapter for desktop-agent tool-calling on top of unsloth/Qwen3.8-27B-unsloth-bnb-4bit (4-bit QLoRA).
Trains the model to act as an autonomous Linux desktop co-worker: reason, call tools, observe results, recover from errors, and stop when no tool is needed.
Research prototype for a multimodal autonomous desktop agent (voice/vision + tool use). Not a general chat upgrade.
unsloth/Qwen3.8-27B-unsloth-bnb-4bit (Qwen3.5 architecture, Qwen3_5ForConditionalGeneration, hybrid Gated DeltaNet + Gated Attention, native 262k context)r=16, lora_alpha=16, lora_dropout=0.0, bias=noneq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (full-attention + MLP)CAUSAL_LM, supervised fine-tuning for tool-callingOpenAI-compatible chat with tools + tool_calls. System message carries tool JSON schemas. Assistant responds with <think>reasoning</think> plus native <tool_call> blocks, or a final answer when no tool is needed.
Supported tool families (client-dependent):
execute_command, read_file, write_fileopen_application, open_browser, navigate_browsergit_operation, run_testpress_key, type_text, take_screenshot, inspect_screenExact tool list is defined by the client. This adapter only decides when and how to call them.
image_url~9,200 deduplicated multi-turn samples, formatted with the native Qwen chat_template.jinja:
| Split | Share | Content |
|---|---|---|
| Single-tool actions | ~30% of synthetic | open app, read file, open browser |
| Software dev workflows | ~30% | read → write → test sequences |
| Error recovery / debugging | ~20% | failing test → inspect → fix → re-test |
| Git lifecycle | ~10% | status → commit → push |
| Negative (no-tool) | ~10% | conceptual questions, answer directly |
| Linux commands | ~8,700 samples | natural-language → shell command, from mecha-org/linux-command-dataset, deduplicated by SHA-256 of normalized prompt+command, mapped to execute_command |
Each sample: system (instructions + tool schemas) + conversations (user / assistant with reasoning_content + tool_calls / tool observation / final answer).
SFTTrainer + PEFT + Transformers 5.xadamw_8bit, gradient checkpointing (Unsloth)adapter_model.safetensors + tokenizer filesNote on low final loss: offline qualitative eval showed contextual reasoning (defensive mkdir before write, status-before-commit, clarifying ambiguous requests) rather than pure memorization, but no formal benchmark is claimed here.
Qualitative post-training check, 6 scenarios, all passed:
No quantitative benchmark (SWE-bench, BFCL, etc.) is reported. Treat accuracy numbers as unevaluated until a formal eval is published.
Install (Colab: restart session after install so bitsandbytes native lib loads):
pip install -U "bitsandbytes>=0.46.1" transformers peft accelerate
Inference (4-bit base + LoRA, Transformers 5.x API):
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
import torch
base_id = "unsloth/Qwen3.8-27B-unsloth-bnb-4bit"
adapter_id = "alfinpratama/qwen38-27b-desktop-agent-lora"
# Qwen3.8 processor wraps text tokenizer; use inner tokenizer for text-only
tok = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
text_tok = getattr(tok, "tokenizer", tok)
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16,
)
model = AutoModelForCausalLM.from_pretrained(
base_id,
quantization_config=bnb_config,
dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
tools = [{
"name": "execute_command",
"description": "Run an allowlisted shell command",
"parameters": {"type": "object",
"properties": {"command": {"type": "string"}},
"required": ["command"]},
}]
messages = [
{"role": "system", "content": "You are a desktop agent. Call tools when needed, otherwise answer directly."},
{"role": "user", "content": "Check today's date via shell."},
]
prompt = text_tok.apply_chat_template(
messages, tools=tools, tokenize=False, add_generation_prompt=True
)
inputs = text_tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, temperature=0.1, do_sample=True)
print(text_tok.decode(out[0], skip_special_tokens=False))
For serving, merge or load via any OpenAI-compatible server that supports PEFT adapters and exposes tools / tool_calls as JSON. Native <tool_call> XML must be parsed to OpenAI delta.tool_calls server-side.