badtheorylabs / btl-2-coder

huggingface.co
Total runs: 15
24-hour runs: 2
7-day runs: 4
30-day runs: 10
Model's Last Updated: June 23 2026
text-generation

Introduction of btl-2-coder

Model Details of btl-2-coder

BTL-2 Coder 7B

BTL-2 Coder 7B is a LoRA adapter for unsloth/Qwen2.5-Coder-7B-Instruct , trained for structured code-review findings.

Code and evaluation scripts are available at:

https://github.com/Badtheorylabs/btl-2-coder
Intended Use

This adapter is intended for local-first code review. It is trained to produce structured findings with:

  • severity
  • file path
  • line number
  • title
  • evidence
  • recommendation
  • numeric confidence

The main supported issue classes are SQL injection, path traversal, authorization bypass, missing error handling, boundary/off-by-one logic, and related security/correctness findings.

The adapter is optimized for review output rather than broad chat behavior.

Training
  • Base model: unsloth/Qwen2.5-Coder-7B-Instruct
  • Method: LoRA SFT with Unsloth
  • Data mix: 4,000 API-generated review traces + 1,000 template traces
  • Train/eval split: 4,500 train examples + 500 eval examples
  • Epochs: 2
  • Max sequence length: 4096

Only redacted, opt-in traces should be used for future training.

Recommended Prompt Contract

Use strict schema prompting:

Return only a JSON array. No markdown and no wrapper object.
Each finding must include: severity, file, line, title, evidence, recommendation, confidence.
severity must be exactly one of: critical, high, medium, low.
Never put a category in severity.
confidence must be a number from 0 to 1, never a string label.
Every finding must include concrete evidence and a non-empty recommendation.

Example output:

[
  {
    "severity": "critical",
    "file": "src/users.ts",
    "line": 42,
    "title": "SQL injection through string-built query",
    "evidence": "The user id is concatenated directly into the SQL string.",
    "recommendation": "Use a parameterized query.",
    "confidence": 0.96
  }
]
Load The Adapter
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = "unsloth/Qwen2.5-Coder-7B-Instruct"
adapter = "badtheorylabs/btl-2-coder"

tokenizer = AutoTokenizer.from_pretrained(adapter)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
Evaluation

Measured on an NVIDIA H200 with 4-bit adapter inference.

Eval JSON parse Schema valid Numeric confidence Category hit File hit Precision Recall Weighted severity recall
Heldout 100 strict 1.000 0.952 1.000 0.783 0.840 n/a n/a n/a
Heldout 30 strict v2 1.000 0.975 1.000 0.867 0.867 n/a n/a n/a
Seeded 15 strict 1.000 1.000 1.000 0.933 1.000 0.933 0.933 0.956

Notes:

  • Heldout precision/recall is marked n/a because the heldout set is broader and does not use one normalized ground-truth finding per example.
  • The seeded benchmark is a controlled regression suite with known findings.
  • Reported results use the recommended strict schema prompt.
Scope
  • Primary task: structured security and correctness review.
  • Output format: JSON findings with severity, location, evidence, recommendation, and confidence.
  • Best runtime path: strict schema prompting, with optional constrained decoding.
  • Evaluation focus: code-review findings, file hits, schema validity, and seeded precision/recall.
  • Next track: patch proposals and terminal workflows.
Files

This repository contains a PEFT/LoRA adapter:

  • adapter_model.safetensors
  • adapter_config.json
  • tokenizer.json
  • tokenizer_config.json
  • chat_template.jinja
  • training_args.bin
  • SHA256SUMS

Runs of badtheorylabs btl-2-coder on huggingface.co

15
Total runs
2
24-hour runs
4
3-day runs
4
7-day runs
10
30-day runs

More Information About btl-2-coder huggingface.co Model

More btl-2-coder license Visit here:

https://choosealicense.com/licenses/apache-2.0

btl-2-coder huggingface.co

btl-2-coder huggingface.co is an AI model on huggingface.co that provides btl-2-coder's model effect (), which can be used instantly with this badtheorylabs btl-2-coder model. huggingface.co supports a free trial of the btl-2-coder model, and also provides paid use of the btl-2-coder. Support call btl-2-coder model through api, including Node.js, Python, http.

badtheorylabs btl-2-coder online free

btl-2-coder huggingface.co is an online trial and call api platform, which integrates btl-2-coder's modeling effects, including api services, and provides a free online trial of btl-2-coder, you can try btl-2-coder online for free by clicking the link below.

badtheorylabs btl-2-coder online free url in huggingface.co:

https://huggingface.co/badtheorylabs/btl-2-coder

btl-2-coder install

btl-2-coder is an open source model from GitHub that offers a free installation service, and any user can find btl-2-coder on GitHub to install. At the same time, huggingface.co provides the effect of btl-2-coder install, users can directly use btl-2-coder installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

btl-2-coder install url in huggingface.co:

https://huggingface.co/badtheorylabs/btl-2-coder

Url of btl-2-coder

Provider of btl-2-coder huggingface.co

badtheorylabs
ORGANIZATIONS

Other API from badtheorylabs

huggingface.co

Total runs: 533
Run Growth: -8.9K
Growth Rate: -1672.42%
Updated:August 07 2026
huggingface.co

Total runs: 354
Run Growth: -691
Growth Rate: -195.20%
Updated:August 07 2026
huggingface.co

Total runs: 76
Run Growth: 31
Growth Rate: 40.79%
Updated:July 24 2026