Text Generation
Transformers
Safetensors
English
code
fluxnat
cybersecurity
vulnerability-detection
sast
security-audit
code-security
cwe
owasp
unsloth
code-analysis
penetration-testing
secure-coding
conversational
custom_code
Instructions to use k4ran909/Fluxnat-Coder-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use k4ran909/Fluxnat-Coder-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="k4ran909/Fluxnat-Coder-3B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("k4ran909/Fluxnat-Coder-3B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use k4ran909/Fluxnat-Coder-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "k4ran909/Fluxnat-Coder-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "k4ran909/Fluxnat-Coder-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/k4ran909/Fluxnat-Coder-3B
- SGLang
How to use k4ran909/Fluxnat-Coder-3B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "k4ran909/Fluxnat-Coder-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "k4ran909/Fluxnat-Coder-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "k4ran909/Fluxnat-Coder-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "k4ran909/Fluxnat-Coder-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use k4ran909/Fluxnat-Coder-3B with Docker Model Runner:
docker model run hf.co/k4ran909/Fluxnat-Coder-3B
Update v0.3.0 Fluxnat architecture config, tokenizer config, and model card
Browse files- README.md +17 -15
- config.json +8 -3
- generation_config.json +47 -2
- tokenizer_config.json +3 -3
README.md
CHANGED
|
@@ -57,11 +57,12 @@ Unlike generic code models that frequently trigger false safety refusals when au
|
|
| 57 |
|
| 58 |
---
|
| 59 |
|
| 60 |
-
## 🚀 Key Capabilities
|
| 61 |
|
| 62 |
- **🔍 Taint Flow & Root Cause Analysis:** Tracks untrusted input from **Source $\rightarrow$ Sanitizer $\rightarrow$ Sink** with explicit causality.
|
| 63 |
-
- **🏷️
|
| 64 |
-
- **
|
|
|
|
| 65 |
- **🛡️ Production-Ready Secure Fixes:** Generates drop-in replacements with parameterized queries, safe execution APIs, and canonicalized path operations.
|
| 66 |
- **⚡ Ultra-Low Latency & Minimal Footprint:** At 3 billion parameters, it fits comfortably into consumer GPUs (4 GB VRAM in 4-bit) and edge environments.
|
| 67 |
|
|
@@ -71,13 +72,13 @@ Unlike generic code models that frequently trigger false safety refusals when au
|
|
| 71 |
|
| 72 |
| Ecosystem | Vulnerabilities Covered |
|
| 73 |
| :--- | :--- |
|
| 74 |
-
| **Python** | SQLi, Command Injection, Path Traversal, Insecure Deserialization (`pickle`/`yaml`), SSRF, Hardcoded Secrets |
|
| 75 |
-
| **JavaScript / TypeScript / Node.js** | DOM XSS, `child_process.exec`, Prototype Pollution,
|
| 76 |
-
| **Go** | Unchecked errors, SSRF (`http.Get`),
|
| 77 |
-
| **C / C++** | Buffer
|
| 78 |
-
| **Java** | JNDI
|
| 79 |
-
| **PHP** | File inclusion (`LFI`/`RFI`), SQLi, `eval` injection, Object
|
| 80 |
-
| **Infrastructure /
|
| 81 |
|
| 82 |
---
|
| 83 |
|
|
@@ -151,20 +152,21 @@ python -m vllm.entrypoints.openai.api_server \
|
|
| 151 |
|
| 152 |
---
|
| 153 |
|
| 154 |
-
## ⚙️ Training Details
|
| 155 |
|
| 156 |
| Hyperparameter | Value |
|
| 157 |
| :--- | :--- |
|
| 158 |
| **Architecture** | 3B Parameter Dense Decoder-Only Transformer |
|
| 159 |
| **Fine-Tuning Framework** | **Unsloth** + TRL `SFTTrainer` |
|
| 160 |
-
| **Method** | QLoRA (4-bit
|
|
|
|
| 161 |
| **LoRA Rank ($r$)** | `64` |
|
| 162 |
| **LoRA Alpha ($\alpha$)** | `128` |
|
| 163 |
| **Target Modules** | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` |
|
| 164 |
-
| **Learning Rate** | `
|
| 165 |
-
| **Effective Batch Size** | `
|
| 166 |
| **Sequence Length** | `4,096` tokens |
|
| 167 |
-
| **Hardware** | 1x NVIDIA Tesla T4 GPU (
|
| 168 |
| **Optimizer** | `adamw_8bit` |
|
| 169 |
|
| 170 |
---
|
|
|
|
| 57 |
|
| 58 |
---
|
| 59 |
|
| 60 |
+
## 🚀 Key Capabilities (`v0.3.0` Red Team Edition)
|
| 61 |
|
| 62 |
- **🔍 Taint Flow & Root Cause Analysis:** Tracks untrusted input from **Source $\rightarrow$ Sanitizer $\rightarrow$ Sink** with explicit causality.
|
| 63 |
+
- **🏷️ 30+ CWE & OWASP Top 10 Mapping:** Maps discovered flaws across 30+ MITRE CWE identifiers (`CWE-89`, `CWE-78`, `CWE-22`, `CWE-79`, `CWE-502`, `CWE-918`, `CWE-611`, `CWE-798`, `CWE-1321`, `CWE-1336`, `CWE-362`, `CWE-416`, etc.) and OWASP categories.
|
| 64 |
+
- **🔴 Offensive Security & Red Team Reasoning:** Analyzes multi-step exploit chains, payload construction (`SQLi`, `XSS`, `SSTI`, `SSRF`, `LFI`, reverse shells), and MITRE ATT&CK techniques (`T1558.003` Kerberoasting, `T1068` Privilege Escalation, `T1547` Persistence, `T1550` Lateral Movement).
|
| 65 |
+
- **🤖 Autonomous ReAct Agent Integration:** Powers the [**SmartAGENT**](https://github.com/k4ran909/smartAGENT) 13-tool security agent (`recon`, `exploit_db`, `generate_payload`, `web_attack`, `post_exploit`, `scan_code`, `fix_code`, etc.).
|
| 66 |
- **🛡️ Production-Ready Secure Fixes:** Generates drop-in replacements with parameterized queries, safe execution APIs, and canonicalized path operations.
|
| 67 |
- **⚡ Ultra-Low Latency & Minimal Footprint:** At 3 billion parameters, it fits comfortably into consumer GPUs (4 GB VRAM in 4-bit) and edge environments.
|
| 68 |
|
|
|
|
| 72 |
|
| 73 |
| Ecosystem | Vulnerabilities Covered |
|
| 74 |
| :--- | :--- |
|
| 75 |
+
| **Python** | SQLi, Command Injection, Path Traversal, Insecure Deserialization (`pickle`/`yaml`), SSRF, SSTI (`Jinja2`), Hardcoded Secrets |
|
| 76 |
+
| **JavaScript / TypeScript / Node.js** | DOM/Reflected XSS, `child_process.exec`, Prototype Pollution (`CWE-1321`), NoSQL Injection (`CWE-943`), ReDoS, JWT |
|
| 77 |
+
| **Go** | Unchecked errors, SSRF (`http.Get`), Path Traversal, Command execution, Race conditions (`CWE-362`) |
|
| 78 |
+
| **C / C++** | Stack/Heap Buffer Overflows (`CWE-120`/`122`/`787`), Use-After-Free (`CWE-416`), Format Strings (`CWE-134`), Integer Overflows (`CWE-190`) |
|
| 79 |
+
| **Java** | JNDI / Log4Shell (`CVE-2021-44228`), XML External Entity / XXE (`CWE-611`), SQLi via Hibernate/JDBC, `ObjectInputStream` Deserialization (`CWE-502`) |
|
| 80 |
+
| **PHP** | File inclusion (`LFI`/`RFI`), SQLi, `eval` injection, PHP Object Injection (`unserialize`), Type Juggling |
|
| 81 |
+
| **Infrastructure / Active Directory** | Dockerfile root user, `.env` secret leaks, Linux SUID/Sudo Privesc, Windows Service/Token Privesc, AD Kerberoasting & ACL abuse |
|
| 82 |
|
| 83 |
---
|
| 84 |
|
|
|
|
| 152 |
|
| 153 |
---
|
| 154 |
|
| 155 |
+
## ⚙️ Training Details (`v0.3.0`)
|
| 156 |
|
| 157 |
| Hyperparameter | Value |
|
| 158 |
| :--- | :--- |
|
| 159 |
| **Architecture** | 3B Parameter Dense Decoder-Only Transformer |
|
| 160 |
| **Fine-Tuning Framework** | **Unsloth** + TRL `SFTTrainer` |
|
| 161 |
+
| **Method** | QLoRA (4-bit Quantization with 16-bit LoRA Adapters, Merged to 16-bit Float) |
|
| 162 |
+
| **Dataset Composition** | 568 balanced sequences (170 Red Team CoT, 24 Multi-Lang Audits, 16 ReAct Tool Trajectories, 15 Identity Alignment) |
|
| 163 |
| **LoRA Rank ($r$)** | `64` |
|
| 164 |
| **LoRA Alpha ($\alpha$)** | `128` |
|
| 165 |
| **Target Modules** | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` |
|
| 166 |
+
| **Learning Rate** | `8e-5` (Cosine Scheduler, 65 Steps, Final Loss `0.8952`) |
|
| 167 |
+
| **Effective Batch Size** | `8` (Batch size 2 $\times$ Gradient Accumulation 4) |
|
| 168 |
| **Sequence Length** | `4,096` tokens |
|
| 169 |
+
| **Hardware** | 1x NVIDIA Tesla T4 GPU (16 GB VRAM) |
|
| 170 |
| **Optimizer** | `adamw_8bit` |
|
| 171 |
|
| 172 |
---
|
config.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"architectures": [
|
| 3 |
-
"
|
| 4 |
],
|
| 5 |
"attention_dropout": 0.0,
|
| 6 |
"bos_token_id": 151643,
|
|
@@ -50,7 +50,7 @@
|
|
| 50 |
],
|
| 51 |
"max_position_embeddings": 32768,
|
| 52 |
"max_window_layers": 70,
|
| 53 |
-
"model_type": "
|
| 54 |
"num_attention_heads": 16,
|
| 55 |
"num_hidden_layers": 36,
|
| 56 |
"num_key_value_heads": 2,
|
|
@@ -68,5 +68,10 @@
|
|
| 68 |
"vocab_size": 151936,
|
| 69 |
"_name_or_path": "k4ran909/Fluxnat-Coder-3B",
|
| 70 |
"model_name": "Fluxnat-Coder-3B",
|
| 71 |
-
"model_author": "Fluxnat"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"architectures": [
|
| 3 |
+
"FluxnatForCausalLM"
|
| 4 |
],
|
| 5 |
"attention_dropout": 0.0,
|
| 6 |
"bos_token_id": 151643,
|
|
|
|
| 50 |
],
|
| 51 |
"max_position_embeddings": 32768,
|
| 52 |
"max_window_layers": 70,
|
| 53 |
+
"model_type": "fluxnat",
|
| 54 |
"num_attention_heads": 16,
|
| 55 |
"num_hidden_layers": 36,
|
| 56 |
"num_key_value_heads": 2,
|
|
|
|
| 68 |
"vocab_size": 151936,
|
| 69 |
"_name_or_path": "k4ran909/Fluxnat-Coder-3B",
|
| 70 |
"model_name": "Fluxnat-Coder-3B",
|
| 71 |
+
"model_author": "Fluxnat",
|
| 72 |
+
"auto_map": {
|
| 73 |
+
"AutoConfig": "configuration_fluxnat.FluxnatConfig",
|
| 74 |
+
"AutoModel": "modeling_fluxnat.FluxnatModel",
|
| 75 |
+
"AutoModelForCausalLM": "modeling_fluxnat.FluxnatForCausalLM"
|
| 76 |
+
}
|
| 77 |
}
|
generation_config.json
CHANGED
|
@@ -10,5 +10,50 @@
|
|
| 10 |
"temperature": 0.7,
|
| 11 |
"top_k": 20,
|
| 12 |
"top_p": 0.8,
|
| 13 |
-
"transformers_version": "5.
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
"temperature": 0.7,
|
| 11 |
"top_k": 20,
|
| 12 |
"top_p": 0.8,
|
| 13 |
+
"transformers_version": "5.5.0",
|
| 14 |
+
"bad_words_ids": [
|
| 15 |
+
[
|
| 16 |
+
54364
|
| 17 |
+
],
|
| 18 |
+
[
|
| 19 |
+
1207,
|
| 20 |
+
16948
|
| 21 |
+
],
|
| 22 |
+
[
|
| 23 |
+
48,
|
| 24 |
+
16948
|
| 25 |
+
],
|
| 26 |
+
[
|
| 27 |
+
80,
|
| 28 |
+
16948
|
| 29 |
+
],
|
| 30 |
+
[
|
| 31 |
+
2804,
|
| 32 |
+
16948
|
| 33 |
+
],
|
| 34 |
+
[
|
| 35 |
+
2101,
|
| 36 |
+
28260
|
| 37 |
+
],
|
| 38 |
+
[
|
| 39 |
+
452,
|
| 40 |
+
28260
|
| 41 |
+
],
|
| 42 |
+
[
|
| 43 |
+
278,
|
| 44 |
+
28260
|
| 45 |
+
],
|
| 46 |
+
[
|
| 47 |
+
48,
|
| 48 |
+
54,
|
| 49 |
+
953
|
| 50 |
+
],
|
| 51 |
+
[
|
| 52 |
+
969,
|
| 53 |
+
3256,
|
| 54 |
+
56550
|
| 55 |
+
]
|
| 56 |
+
],
|
| 57 |
+
"model_name": "Fluxnat-Coder-3B",
|
| 58 |
+
"author": "Fluxnat"
|
| 59 |
+
}
|
tokenizer_config.json
CHANGED
|
@@ -21,12 +21,11 @@
|
|
| 21 |
"<|video_pad|>"
|
| 22 |
],
|
| 23 |
"is_local": false,
|
| 24 |
-
"local_files_only": false,
|
| 25 |
"model_max_length": 32768,
|
| 26 |
"pad_token": "<|PAD_TOKEN|>",
|
| 27 |
"padding_side": "left",
|
| 28 |
"split_special_tokens": false,
|
| 29 |
-
"tokenizer_class": "
|
| 30 |
"unk_token": null,
|
| 31 |
"added_tokens_decoder": {
|
| 32 |
"151643": {
|
|
@@ -214,5 +213,6 @@
|
|
| 214 |
"special": true
|
| 215 |
}
|
| 216 |
},
|
| 217 |
-
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are
|
|
|
|
| 218 |
}
|
|
|
|
| 21 |
"<|video_pad|>"
|
| 22 |
],
|
| 23 |
"is_local": false,
|
|
|
|
| 24 |
"model_max_length": 32768,
|
| 25 |
"pad_token": "<|PAD_TOKEN|>",
|
| 26 |
"padding_side": "left",
|
| 27 |
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 29 |
"unk_token": null,
|
| 30 |
"added_tokens_decoder": {
|
| 31 |
"151643": {
|
|
|
|
| 213 |
"special": true
|
| 214 |
}
|
| 215 |
},
|
| 216 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Fluxnat Coder 3B, an elite AI cybersecurity and secure coding intelligence model created by Fluxnat.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Fluxnat Coder 3B, an elite AI cybersecurity and secure coding intelligence model created by Fluxnat.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
|
| 217 |
+
"name_or_path": "k4ran909/Fluxnat-Coder-3B"
|
| 218 |
}
|