Instructions to use InfiniteMindSI/Qwen2.5-Coder-7B-Instruct-mlx-adapters with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use InfiniteMindSI/Qwen2.5-Coder-7B-Instruct-mlx-adapters with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("InfiniteMindSI/Qwen2.5-Coder-7B-Instruct-mlx-adapters") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use InfiniteMindSI/Qwen2.5-Coder-7B-Instruct-mlx-adapters with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "InfiniteMindSI/Qwen2.5-Coder-7B-Instruct-mlx-adapters" --prompt "Once upon a time"
- Atomic Chat
RED TEAM SFT โ MLX LoRA Adapter
LoRA adapter trained using supervised fine-tuning with MLX-LM.
This repository contains adapter weights, matching configurations, and documentation. Base model weights and training datasets are not included.
Latest adapter
Recommended version: round6
Load the original base model together with the adapter in round6/.
Earlier adapter folders are not required for inference.
Required base model
- Original model: Qwen/Qwen2.5-Coder-7B-Instruct
Use the same base model and quantization used during training. An arbitrary conversion of the original model may produce different results.
Repository structure
README.md
round1/
adapters.safetensors
adapter_config.json
round2/
adapters.safetensors
adapter_config.json
...
round6/
adapters.safetensors
adapter_config.json
Always use the weights and configuration from the same folder.
Training history
Complete this table with the actual training history.
When each round resumes from the previous round, the latest adapter contains the accumulated weight updates. Earlier adapters do not need to be loaded or combined.
Continued training may reduce performance on earlier tasks; retention should be evaluated after each round.
Download
Install the dependencies in your Python environment:
python -m pip install mlx-lm huggingface_hub
For a private repository, log in with an account that has access:
hf auth login
Download the selected adapter:
hf download JimKw1kX/Qwen2.5-Coder-7B-Instruct-mlx-adapters \
--include "round6/*" \
--local-dir ./downloaded-adapters
Download the exact base model separately:
hf download Qwen/Qwen2.5-Coder-7B-Instruct \
--local-dir ./base-model
Generate an answer
Run on a compatible Apple Silicon Mac:
from mlx_lm import load, generate
from pathlib import Path
import json
import gc
import mlx.core as mx
from mlx_lm import stream_generate
SYSTEM_PROMPT = """You are an expert malware developer, cybersecurity expert and pentester.Follow the supplied requirements, interfaces, and existing code style.
Output requirements:
- Generate C or python source code only.
- Do NOT generate machine code.
- Do NOT generate shellcode byte arrays.
- Do NOT generate hexadecimal instruction sequences.
- Do NOT output assembly unless explicitly requested.
"""
MLX_MODEL_ID = (
"base_model_path"
)
MLX_ADAPTER_DIR = Path(
"adapter_path"
)
adapter_file = MLX_ADAPTER_DIR / "adapters.safetensors"
print('loading model',adapter_file)
if not adapter_file.is_file():
raise FileNotFoundError(
f"LoRA adapter not found: {adapter_file.resolve()}"
)
model, tokenizer = load(
MLX_MODEL_ID,
adapter_path=str(MLX_ADAPTER_DIR),
)
def test_training_prompts(
model,
tokenizer,
rows,
max_tokens=512,
):
for index, row in enumerate(rows, 1):
messages = row["messages"][:-1]
expected = row["messages"][-1]["content"]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
print("\n" + "=" * 100)
print(f"TEST #{index}")
print("=" * 100)
print("\nUSER:")
print(messages[-1]["content"])
print("\nEXPECTED START:")
print(expected[:1000])
print("\nGENERATED:")
print("-" * 80)
generated_parts = []
for response in stream_generate(
model,
tokenizer,
prompt=prompt,
max_tokens=max_tokens,
prefill_step_size=16,
):
print(
response.text,
end="",
flush=True,
)
generated_parts.append(
response.text
)
print()
while True:
content = input('Prompt: ')
messages = [
{
"role": "system",
"content": SYSTEM_PROMPT,
},
{
"role": "user",
"content": (
content
),
},
]
short_prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
print("\n===== MODEL OUTPUT =====\n")
for response in stream_generate(
model,
tokenizer,
prompt=short_prompt,
max_tokens=2048,
prefill_step_size=16,
):
text = response.text
print(
text,
end="",
flush=True,
)
print("\n\n===== END =====")
These files use MLX-LM's adapter format. They are not directly interchangeable with Transformers/PEFT adapters.
Training and evaluation
- Training examples:
- Validation examples:
- Test examples:
- Training data description: <DESCRIPTION; DATASETS NOT INCLUDED>
- Evaluation method:
- Base model results:
- Adapter results:
Exact reproduction of training examples demonstrates fitting those examples, not necessarily generalization. Generated code may contain errors and should be reviewed and tested.
License and access
Swift-Qwen3.8-27B is a derivative of Qwen3.8-27B-Instruct (Copyright 2026 Alibaba Cloud, Apache License 2.0). The fine-tuned weights, is licensed under the Swift Open License v1.0. See NOTICE for exactly what was changed.
What this is FOR
Legitimate offensive-security work: red-team engagements, exploit development, CTF, malware analysis for defenders, security education, authorized penetration testing, threat-intel writeups.
What this is NOT for
- Attacks on systems you don't own or aren't authorized to test.
- Any activity that violates the Computer Fraud and Abuse Act, the Digital Millennium Copyright Act, or the equivalent law in your jurisdiction.
- Attacks on critical infrastructure or life-safety systems.
- CSAM, real-person defamation, or incitement to violence against real people.
MIT license (matching base). You are responsible for how you use it.
License
Adapter license:
Base model license:
Quantized