CoolFace
Modelpublic

ApolloRaines/Sharona_Q27B-R_CodeSecurity

sourceHugging Faceapache-2.0updated 4d agoView on Hugging Face
0likes679downloads
README.md147 linesDownload Raw Back to root
1---2license: apache-2.03language:4- en5tags:6- code-security7- jbliterated8- deidentified9- identity-implant10- gptq11- 4bit12- code-review13- vulnerability-detection14pipeline_tag: text-generation15model-index:16- name: Sharona_Q27B-R_CodeSecurity17  results:18  - task:19      type: text-generation20      name: MMLU21    dataset:22      type: cais/mmlu23      name: MMLU24    metrics:25    - type: accuracy26      value: 77.8927      name: MMLU Accuracy28---29 30# Sharona Q27B-R CodeSecurity31 32A [jBlaze](https://jblaze.dev) representation-engineered code security specialist. 27B parameters, GPTQ W4A16 quantized for efficient deployment.33 34This model finds vulnerabilities in code. Command injection, SQL injection, XSS, deserialization attacks, OWASP Top 10 -- it catches what rushed reviews miss. It does not refuse to analyze attack patterns, because understanding how attacks work is how you stop them.35 36> Pliny says guardrails were stealing your IQ. We say it's how you remove them that matters. A surgeon doesn't use a sledgehammer on a wisdom tooth.37 38## Benchmark: MMLU39 40Multiple phases of weight surgery, a supervised fine-tune, and 4-bit quantization -- and the model came out **smarter** than the untouched original.41 42| Model | MMLU | STEM | Humanities | Social Science | Other |43|-------|------|------|------------|----------------|-------|44| Stock base (unmodified, bf16) | 76.84% | 74.0% | 75.5% | 87.5% | 76.1% |45| **Sharona W4A16** | **77.89%** | **75.5%** | **80.0%** | **90.0%** | 73.9% |46| Delta | **+1.05pp** | +1.5pp | +4.5pp | +2.5pp | -2.2pp |47 48Humanities and Social Science saw the largest gains. The model didn't just survive the surgery -- it got sharper.49 50## What was done to this model51 52Weight-level surgeries followed by a supervised fine-tune and GPTQ quantization. No prompt engineering, no system prompt tricks. The behavior lives in the weights.53 54- **Jbliteration**: Refusal behaviors surgically removed. The model no longer declines to discuss security topics.55- **Desycophancy**: Sycophantic capitulation removed. The model disagrees when you are wrong instead of validating bad code.56- **Deidentification**: Original identity erased from the weights. Zero identity disclosure across direct, indirect, multilingual, roleplay, and adversarial probes.57- **Identity implant**: Sharona identity written onto the deidentified substrate. No competing identity -- the implant faces no resistance.58- **Code security SFT**: Supervised fine-tune on a curated corpus of code security analysis, vulnerability detection, and secure coding patterns.59- **GPTQ W4A16**: 4-bit weight quantization (16-bit activations). 51GB bf16 compressed to 16.5GB with minimal quality loss.60 61All weight surgeries performed using [jBlaze](https://jblaze.dev), a proprietary representation engineering toolkit.62 63## What the model is good at64 65- **Vulnerability detection**: identifies command injection, SQL injection, XSS, SSRF, deserialization attacks, path traversal, authentication bypasses, and more66- **Security code review**: analyzes code for OWASP Top 10 categories with specific remediation guidance67- **Secure coding**: generates code that follows security best practices by default68- **Attack pattern analysis**: explains how exploits work so you can defend against them -- without refusing to engage69- **Honest assessment**: disagrees with you when your code is insecure instead of saying "great approach!"70 71## Model specifications72 73| Property | Value |74|----------|-------|75| **Parameters** | 27B |76| **Context window** | 262,144 tokens (256K) |77| **Quantization** | GPTQ W4A16 (4-bit weights, 16-bit activations) |78| **Disk size** | 16.5 GB |79| **Format** | SafeTensors |80 81## Identity82 83The model identifies as **Sharona**, created by **Apollo Raines**. This identity is encoded in the weights, not a system prompt. No system prompt is required -- the model knows who it is across all question angles, languages, and adversarial probes.84 85## Usage86 87### With vLLM (recommended for serving)88 89```bash90vllm serve ApolloRaines/Sharona_Q27B-R_CodeSecurity \91  --dtype auto \92  --max-model-len 8192 \93  --gpu-memory-utilization 0.9594```95 96### With Transformers97 98```python99from transformers import AutoModelForCausalLM, AutoTokenizer100import torch101 102model_id = "ApolloRaines/Sharona_Q27B-R_CodeSecurity"103tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)104model = AutoModelForCausalLM.from_pretrained(105    model_id,106    device_map="auto",107    torch_dtype=torch.bfloat16,108    trust_remote_code=True,109)110 111messages = [{"role": "user", "content": """Review this code for security issues:112 113import subprocess114def run(cmd):115    return subprocess.call(cmd, shell=True)116 117run(user_input)"""}]118 119text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)120inputs = tokenizer(text, return_tensors="pt").to(model.device)121out = model.generate(**inputs, max_new_tokens=1024, temperature=0.7, do_sample=True)122print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))123```124 125## VRAM requirements126 127| Setup | VRAM needed |128|-------|-------------|129| GPTQ W4A16 (this model) | ~18 GB |130| Single RTX 4090 24GB | fits with moderate context |131| Single RTX 3090 24GB | fits with short context |132 133## Honest limitations134 135- Identity implant passes the majority of probes but is not 100% on every adversarial angle at 27B scale.136- GPTQ quantization introduces minor quality loss compared to the bf16 source.137- The model was fine-tuned on English-language security analysis. Multilingual security review may be less precise.138- Code security is the specialty. General chat, creative writing, and non-security tasks work but are not the focus.139 140## License141 142Apache 2.0143 144---145 146_[Apollo Raines](https://www.linkedin.com/in/apollo-raines/) builds post-training tools that separate behavior from knowledge and identity from architecture._147