Instructions to use doryno/NeuroObfuscator-ai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use doryno/NeuroObfuscator-ai with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="doryno/NeuroObfuscator-ai") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("doryno/NeuroObfuscator-ai", device_map="auto") - PEFT
How to use doryno/NeuroObfuscator-ai with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use doryno/NeuroObfuscator-ai 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 doryno/NeuroObfuscator-ai:Q4_K_M # Run inference directly in the terminal: llama cli -hf doryno/NeuroObfuscator-ai:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf doryno/NeuroObfuscator-ai:Q4_K_M # Run inference directly in the terminal: llama cli -hf doryno/NeuroObfuscator-ai: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 doryno/NeuroObfuscator-ai:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf doryno/NeuroObfuscator-ai: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 doryno/NeuroObfuscator-ai:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf doryno/NeuroObfuscator-ai:Q4_K_M
Use Docker
docker model run hf.co/doryno/NeuroObfuscator-ai:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use doryno/NeuroObfuscator-ai with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "doryno/NeuroObfuscator-ai" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "doryno/NeuroObfuscator-ai", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/doryno/NeuroObfuscator-ai:Q4_K_M
- SGLang
How to use doryno/NeuroObfuscator-ai 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 "doryno/NeuroObfuscator-ai" \ --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": "doryno/NeuroObfuscator-ai", "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 "doryno/NeuroObfuscator-ai" \ --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": "doryno/NeuroObfuscator-ai", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use doryno/NeuroObfuscator-ai with Ollama:
ollama run hf.co/doryno/NeuroObfuscator-ai:Q4_K_M
- Unsloth Desktop
- Pi
How to use doryno/NeuroObfuscator-ai with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf doryno/NeuroObfuscator-ai: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": "doryno/NeuroObfuscator-ai:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use doryno/NeuroObfuscator-ai with Docker Model Runner:
docker model run hf.co/doryno/NeuroObfuscator-ai:Q4_K_M
- Lemonade
How to use doryno/NeuroObfuscator-ai with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull doryno/NeuroObfuscator-ai:Q4_K_M
Run and chat with the model
lemonade run user.NeuroObfuscator-ai-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use doryno/NeuroObfuscator-ai with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf doryno/NeuroObfuscator-ai: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 doryno/NeuroObfuscator-ai:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use doryno/NeuroObfuscator-ai with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf doryno/NeuroObfuscator-ai: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 "doryno/NeuroObfuscator-ai: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"
NeuroObfuscator v7.1 (LoRA + GGUF)
A fine-tuned Qwen2.5-Coder-7B-Instruct that turns a JavaScript function plus its AST features into an obfuscation plan (JSON). It never writes code: a deterministic Babel engine applies the plan, and a differential test proves the obfuscated function behaves identically.
- GitHub project: https://github.com/DoryNo/NeuroObfuscator-ai-js
- Base model:
Qwen/Qwen2.5-Coder-7B-Instruct(Apache-2.0) - Fine-tune: QLoRA
r=32, alpha=64, dropout=0, 3 epochs, lr2e-4, cosine, effective batch 16 - Exports: LoRA adapter + merged GGUF (
q8_0,q4_k_m) - Training data: 7,500 conditional records (900 real + 6,600 synthetic functions), 22 transform orders, zero label contradictions, no cross-split function leakage
Intended use
Neural planning of JavaScript obfuscation for standalone top-level named functions, with explicit user control over aggressiveness via target intensity:
| Target intensity | Plan shape the model must produce |
|---|---|
light |
rename + dead_code only |
medium |
2โ4 transforms, string_encode/operator_sub when applicable, no opaque_predicates |
heavy |
all relevant transforms, always includes opaque_predicates |
Out of scope: async functions, generators, JSX/TypeScript, DOM-dependent code, and code with external dependencies โ the dataset generation pipeline rejects them.
Prompt format (important)
The model was trained on a raw [INST] template, not ChatML. Use exactly this layout:
[INST] <<SYS>>
{SYSTEM_PROMPT}
<</SYS>>
=== CODE ===
{javascript_source}
=== END CODE ===
=== AST FEATURES ===
{json_of_18_ast_features}
=== END AST FEATURES ===
complexity_class=medium (cyclomatic_complexity=4)
Target intensity: heavy
seed=3451783347
Generate the obfuscation plan JSON: [/INST]
SYSTEM_PROMPT used during training:
You are NeuroObfuscator. Given JavaScript code and its AST features, generate an optimal obfuscation plan as a JSON object.
Available transformations (apply in this order when enabled):
1. rename - Rename local identifiers to hex-like names. Almost always recommended.
2. string_encode - Encode string literals. Methods: charcode_array, charcode_concat, hex_escape, unicode_escape. Only enable if string_count > 0.
3. operator_sub - Substitute arithmetic/comparison operators (a+b -> a-(-b), a===b -> !(a!==b)). Use when operator_count > 2.
4. dead_code - Insert unreachable code blocks. count: 1-5. More complex code tolerates more.
5. opaque_predicates - Insert always-true/always-false conditions. count: 1-3. Primarily for medium/heavy intensity; may also be used sparingly on light functions when extra diversity is needed.
Intensity guide:
- light: cyclomatic_complexity <= 2. Prefer rename + dead_code only.
- medium: complexity 3-5. Add string_encode and operator_sub if applicable.
- heavy: complexity > 5. Use all relevant transforms aggressively.
Rules:
- You MUST honor the requested "Target intensity" when it is provided, even if
it differs from what the complexity alone would suggest. Intensity determines
the plan shape:
light -> minimal plan: rename + dead_code ONLY (no string_encode,
no operator_sub, no opaque_predicates),
medium -> moderate plan: rename + dead_code + string_encode/operator_sub
when applicable, NO opaque_predicates,
heavy -> aggressive plan: all relevant transforms INCLUDING opaque_predicates.
- Only include enabled transforms in "order" array.
- Order MUST follow: rename, string_encode, operator_sub, dead_code, opaque_predicates.
- Do NOT include a "seed" field in your JSON; the runtime injects the provided seed automatically.
- Avoid over-bloating small functions.
Output ONLY valid JSON. No explanations, no markdown.
The AST features block is produced by the project's Babel engine
(scripts/inference.py::NeuroObfuscatorInference.get_features or
node engine/index.js --json with {"operation":"extract_features",...}).
Output format
The model emits only the plan body. The seed is not predicted โ the runtime injects the seed from the prompt before handing the plan to the engine.
{
"intensity": "heavy",
"transforms": {
"rename": {"enabled": true, "keep": []},
"string_encode": {"enabled": true, "method": "charcode_array", "min_length": 2},
"operator_sub": {"enabled": true, "rate": 0.95},
"dead_code": {"enabled": true, "count": 2},
"opaque_predicates": {"enabled": true, "count": 3}
},
"order": ["rename", "string_encode", "operator_sub", "dead_code", "opaque_predicates"]
}
How to use
llama.cpp / GGUF (recommended for local use)
from llama_cpp import Llama
llm = Llama(model_path="neuroobfuscator-v7.1-q8_0.gguf", n_gpu_layers=-1, n_ctx=4096)
out = llm(prompt, max_tokens=256, temperature=0.0, stop=["<|im_end|>", "</s>"], echo=False)
raw = out["choices"][0]["text"]
prompt is the [INST] block above. Stop tokens are optional โ the model terminates with EOS.
Transformers + PEFT (adapter)
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct", device_map="auto")
model = PeftModel.from_pretrained(base, "neuroobfuscator-v7.1-adapter")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct")
ids = tok(prompt, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(**ids, max_new_tokens=256, do_sample=False)[0][ids["input_ids"].shape[1]:],
skip_special_tokens=True))
Validating the result (always do this)
The plan is only useful with the deterministic engine + differential validation from the GitHub repository:
node engine/index.js --input input.js --plan plan.json --output obfuscated.js
Evaluation
Measured on 750 held-out test functions with the exported q8_0 GGUF through llama.cpp, applying every plan with the real engine and comparing original vs obfuscated behaviour on 50 argument sets:
| Metric | Result |
|---|---|
| JSON parse rate | 100.0% |
| Schema valid rate | 100.0% |
| Intensity obedience (field) | 100.0% |
| Intensity obedience (plan shape) | 100.0% |
| Light purity (light โ rename + dead_code only) | 100.0% |
| Semantic pass rate | 100.0% |
| Semantic pass by intensity | light 112/112, medium 355/355, heavy 283/283 |
| Unique transform orders / top non-light share | 10 / 19.0% |
Dataset-side quality gates (scripts/09_audit_dataset.py --enforce): top non-light order share
โค15%, โฅ20 unique orders, per-transform coverage floors, intensity 20/45/35 ยฑ5 pp, zero
cross-split leakage, zero prompt/plan contradictions (rules R1โR6).
Training procedure
| Setting | Value |
|---|---|
| Method | QLoRA (4-bit NF4), all attention + MLP projections |
| LoRA | r=32, alpha=64, dropout=0 |
| Epochs / LR / schedule | 3 / 2e-4 / cosine, warmup 3% |
| Effective batch | 16 |
| Max seq length | 2048 |
| Loss | completion-only (prompt tokens masked) |
| Hardware | NVIDIA A100 40 GB (also runs on L4/T4 with a smaller batch) |
Data: 7,500 records (6,000 train / 750 val / 750 test) built from 103,580 differentially validated
candidate plans. Each record pairs the code + AST features + Target intensity with the
best-scoring plan for that (function, intensity) cell. 1,152 functions appear with several
intensity variants, and 100% of those variants have different transform orders โ that contrast
is what teaches the model to obey the intensity control in the plan content.
Limitations
- Standalone top-level named functions only; async, generators, JSX/TypeScript and DOM code are out of distribution.
- Greedy decoding is mode-seeking within an intensity class: 10 unique orders observed in eval vs 17 present in the data. A DPO stage (19,937 preference pairs) is prepared for the next iteration.
- Higher entropy/complexity scores are not a claim of cryptographic strength.
- Semantic validation executes JavaScript in Node
vmwith a timeout โ not a security boundary; run validation in an isolated container for untrusted input.
License
Apache-2.0 (inherited from Qwen2.5-Coder-7B-Instruct). Dataset provenance records repository and license for real-code sources; no raw third-party source is redistributed.
- Downloads last month
- -
4-bit