How to use from
Unsloth Studio
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for oke39/llama3-8b-secure-code to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for oke39/llama3-8b-secure-code to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required
# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for oke39/llama3-8b-secure-code to start chatting
Load model with FastModel
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
    model_name="oke39/llama3-8b-secure-code",
    max_seq_length=2048,
)
Quick Links

Jack: The Secure Code Agent (Llama-3 8B)

Jack is a specialized fine-tune of Llama-3 8B, engineered to detect and fix security vulnerabilities in Python code. It acts as an automated security auditor, taking insecure code as input and outputting a hardened, secure version.

Key Metrics

Metric Score Description
Bandit Pass Rate 88.0% Percentage of fixes that pass the Bandit static analysis security tool.
BLEU Score 69.27 High structural similarity to human-expert security patches.

Quick Start

You can use this model directly via the Hugging Face Inference API or load it locally.

Inference API (Serverless)

import requests

API_URL = "[/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2Foke39%2Fllama3-8b-secure-code%5D(https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2Foke39%2Fllama3-8b-secure-code)"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}

payload = {
    "inputs": """<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are Jack, a Secure Code Agent. Fix the security vulnerability in the provided code.<|eot_id|><|start_header_id|>user<|end_header_id|>

def login(username, password):
    # Vulnerable SQL Injection
    query = "SELECT * FROM users WHERE username = '" + username + "' AND password = '" + password + "'"
    cursor.execute(query)<|eot_id|><|start_header_id|>assistant<|end_header_id|>
"""
}

response = requests.post(API_URL, headers=headers, json=payload)
print(response.json())

Training Details

  • Dataset: Vulnerability Fix Dataset
  • Vulnerabilities Covered: SQL Injection, XSS, Command Injection, Insecure Deserialization, Hardcoded Credentials.

Training Details

Uploaded finetuned model

  • Developed by: oke39
  • License: apache-2.0
  • Finetuned from model : unsloth/llama-3-8b-Instruct-bnb-4bit

This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.

Downloads last month
18
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for oke39/llama3-8b-secure-code

Finetuned
(1133)
this model