Instructions to use bencodez/Cipheron with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use bencodez/Cipheron with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf bencodez/Cipheron:Q4_K_M # Run inference directly in the terminal: llama cli -hf bencodez/Cipheron:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf bencodez/Cipheron:Q4_K_M # Run inference directly in the terminal: llama cli -hf bencodez/Cipheron:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf bencodez/Cipheron:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf bencodez/Cipheron:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf bencodez/Cipheron:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf bencodez/Cipheron:Q4_K_M
Use Docker
docker model run hf.co/bencodez/Cipheron:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use bencodez/Cipheron with Ollama:
ollama run hf.co/bencodez/Cipheron:Q4_K_M
- Unsloth Desktop
- Pi
How to use bencodez/Cipheron with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bencodez/Cipheron:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "bencodez/Cipheron:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use bencodez/Cipheron with Docker Model Runner:
docker model run hf.co/bencodez/Cipheron:Q4_K_M
- Lemonade
How to use bencodez/Cipheron with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bencodez/Cipheron:Q4_K_M
Run and chat with the model
lemonade run user.Cipheron-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use bencodez/Cipheron with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bencodez/Cipheron:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default bencodez/Cipheron:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use bencodez/Cipheron with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bencodez/Cipheron:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "bencodez/Cipheron:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
tags:
|
| 5 |
- code
|
| 6 |
- security
|
| 7 |
- secure-coding
|
| 8 |
-
- lora
|
| 9 |
-
- qwen2.5-coder
|
| 10 |
language:
|
| 11 |
- en
|
| 12 |
pipeline_tag: text-generation
|
|
@@ -14,34 +23,37 @@ pipeline_tag: text-generation
|
|
| 14 |
|
| 15 |
# Cipheron
|
| 16 |
|
| 17 |
-
**Cipheron** is a
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
- **Method**: LoRA fine-tuning (r=16, alpha=32), 3 epochs, ~830 steps
|
| 21 |
-
- **Training data**: [CyberNative/Code_Vulnerability_Security_DPO](https://huggingface.co/datasets/CyberNative/Code_Vulnerability_Security_DPO) (~4.6k vulnerable/secure code pairs across 11 languages), trained on the secure ("chosen") responses only
|
| 22 |
-
- **Size**: 0.5B parameters
|
| 23 |
-
- **Formats**: full-precision merged model (this repo) and a `Cipheron-Q8_0.gguf` quantized file for on-device / CPU / phone use via llama.cpp, Ollama, or similar runners
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
-
- **
|
| 29 |
-
- **Command injection** (rewrites `os.system`/shell string concatenation as safer `subprocess` calls)
|
| 30 |
|
| 31 |
-
These
|
| 32 |
|
| 33 |
-
## Known
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
The training dataset is heavily imbalanced (e.g. ~30% buffer-overflow examples, mostly in memory-unsafe languages like C/C++, largely irrelevant to Python; some important categories like path traversal, hardcoded secrets, and weak cryptography have only a handful of examples total). As a result, in testing Cipheron **failed to correctly fix**:
|
| 36 |
- Path traversal
|
| 37 |
-
- Hardcoded secrets
|
| 38 |
-
- Weak
|
| 39 |
-
- Insecure deserialization
|
| 40 |
- Reflected XSS
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
## Usage
|
| 47 |
|
|
@@ -50,19 +62,46 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 50 |
import torch
|
| 51 |
|
| 52 |
tokenizer = AutoTokenizer.from_pretrained("bencodez/Cipheron")
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
messages = [
|
| 56 |
-
{
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
]
|
| 59 |
-
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=False)
|
| 60 |
-
out = model.generate(input_ids, max_new_tokens=250)
|
| 61 |
-
print(tokenizer.decode(out[0][input_ids.shape[1]:], skip_special_tokens=True))
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
Or with the GGUF file via `llama-cpp-python` / llama.cpp / Ollama for lightweight CPU/on-device inference.
|
| 65 |
-
|
| 66 |
-
## License
|
| 67 |
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- code
|
| 5 |
+
- security
|
| 6 |
+
- secure-coding
|
| 7 |
+
language:
|
| 8 |
+
- en
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
+
---
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
|
| 13 |
+
readme = """---
|
| 14 |
+
license: apache-2.0
|
| 15 |
tags:
|
| 16 |
- code
|
| 17 |
- security
|
| 18 |
- secure-coding
|
|
|
|
|
|
|
| 19 |
language:
|
| 20 |
- en
|
| 21 |
pipeline_tag: text-generation
|
|
|
|
| 23 |
|
| 24 |
# Cipheron
|
| 25 |
|
| 26 |
+
**Cipheron** is a lightweight coding model designed for **secure code review**.
|
| 27 |
+
|
| 28 |
+
It analyzes source code for common security vulnerabilities and attempts to explain the issue and provide a safer implementation.
|
| 29 |
|
| 30 |
+
## What Cipheron Is Good At
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
Cipheron performs particularly well on:
|
| 33 |
|
| 34 |
+
- **SQL injection** — identifying unsafe query construction and recommending parameterized queries.
|
| 35 |
+
- **Command injection** — identifying unsafe shell command construction and recommending safer subprocess-based approaches.
|
|
|
|
| 36 |
|
| 37 |
+
These vulnerability classes are strongly represented in its evaluation data.
|
| 38 |
|
| 39 |
+
## Known Limitations
|
| 40 |
+
|
| 41 |
+
Cipheron has limited reliability across many security vulnerability categories.
|
| 42 |
+
|
| 43 |
+
In testing, it struggled with:
|
| 44 |
|
|
|
|
| 45 |
- Path traversal
|
| 46 |
+
- Hardcoded secrets and API keys
|
| 47 |
+
- Weak password hashing
|
| 48 |
+
- Insecure deserialization
|
| 49 |
- Reflected XSS
|
| 50 |
+
- Complex multi-step security vulnerabilities
|
| 51 |
+
|
| 52 |
+
For these cases, the model may produce changes that appear security-related but do not actually eliminate the underlying vulnerability.
|
| 53 |
|
| 54 |
+
**Do not rely on Cipheron as a replacement for professional security review, static analysis, penetration testing, or a larger security-focused model.**
|
| 55 |
|
| 56 |
+
Cipheron is best considered a lightweight, experimental tool for first-pass security analysis and secure-coding experimentation.
|
| 57 |
|
| 58 |
## Usage
|
| 59 |
|
|
|
|
| 62 |
import torch
|
| 63 |
|
| 64 |
tokenizer = AutoTokenizer.from_pretrained("bencodez/Cipheron")
|
| 65 |
+
|
| 66 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 67 |
+
"bencodez/Cipheron",
|
| 68 |
+
torch_dtype=torch.bfloat16
|
| 69 |
+
)
|
| 70 |
|
| 71 |
messages = [
|
| 72 |
+
{
|
| 73 |
+
"role": "system",
|
| 74 |
+
"content": (
|
| 75 |
+
"You are a secure coding assistant. "
|
| 76 |
+
"Review code for security vulnerabilities "
|
| 77 |
+
"and provide fixed, secure versions."
|
| 78 |
+
)
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"role": "user",
|
| 82 |
+
"content": """Review this code for security issues and fix it:
|
| 83 |
+
|
| 84 |
+
def get_user(username):
|
| 85 |
+
query = "SELECT * FROM users WHERE username = '" + username + "'"
|
| 86 |
+
return db.execute(query)"""
|
| 87 |
+
},
|
| 88 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
+
input_ids = tokenizer.apply_chat_template(
|
| 91 |
+
messages,
|
| 92 |
+
add_generation_prompt=True,
|
| 93 |
+
return_tensors="pt",
|
| 94 |
+
return_dict=False
|
| 95 |
+
)
|
| 96 |
+
|
| 97 |
+
out = model.generate(
|
| 98 |
+
input_ids,
|
| 99 |
+
max_new_tokens=250
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
+
print(
|
| 103 |
+
tokenizer.decode(
|
| 104 |
+
out[0][input_ids.shape[1]:],
|
| 105 |
+
skip_special_tokens=True
|
| 106 |
+
)
|
| 107 |
+
)
|