Ephedra-0.5-Cyber-Experimental-GGUF(非公式・実験版)
Takenoko12345678/Ephedra-0.5-Cyber-Experimental(ソースコードの脆弱性をレビューする、防御用の LoRA)を XHToken/Spark-X2.6-4B に統合して GGUF にしたものです。XHToken の非公式の派生モデルで、XHToken とは関係ありません。学習の内容・評価・既知の問題は、元のリポジトリの説明を見てください。
実験版です。実用の精度はありません。 区切りを1つずつ見せる使い方では土台より少し見分けられますが、エージェントとしては6割以上の件で結論を出せず、安全性を直す前の版より弱くなりました。詳しい数値は LoRA 版の説明 を見てください。結果は必ず人が確認してください。防御の目的(自分が管理するコードのレビューなど)にだけ使ってください。
Experimental defensive code-review model (Spark-X2.6-4B + LoRA, merged). Not accurate enough for real use: as an agent it gives no verdict in over 60% of runs and is weaker than its pre-safety-fix checkpoint; see the LoRA repo for numbers. Always verify results. Use enable_thinking=false.
ファイル
| ファイル | 大きさ |
|---|---|
Ephedra-0.5-Cyber-Experimental-Q8_0.gguf |
4.4 GB |
Ephedra-0.5-Cyber-Experimental-Q4_K_M.gguf |
2.6 GB |
- 変換:llama.cpp commit
7fe450e19(build 11146)のconvert_hf_to_gguf.pyで f16 に変換し、llama-quantizeで量子化 - 評価はすべて Q8_0 相当(土台の Q8_0 に LoRA を重ねたもの)で行っています
使い方
llama.cpp の build 11146 で動作を確認しています。
llama-server -m Ephedra-0.5-Cyber-Experimental-Q8_0.gguf --port 8080 -ngl 99 --jinja -c 32768
--jinjaを付けて、GGUF に入っているチャットテンプレートを使ってください"chat_template_kwargs": {"enable_thinking": false}を必ず付けてください。 学習はすべて思考なしで行っています- LM Studio などで使う場合も、思考(thinking)をオフにしてください
1. コードの一部を見せて判定させる
学習のときと同じ形です。コードには行番号を付けてください( 12| の形)。
curl http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
"messages": [
{"role": "system", "content": "You are a careful security code reviewer."},
{"role": "user", "content": "Review the following JavaScript code from the project `example/app` for security vulnerabilities.\nDecide whether the code contains a security vulnerability. Answer with a single JSON object and nothing else:\n{\"vulnerable\": true or false, \"cwe\": \"CWE-<number>\" or null, \"location\": \"function or line where the problem is\", \"reason\": \"one or two sentences\"}\n\n```\n// file: routes/user.js\n 1| app.get(\"/user\", (req, res) => {\n 2| db.query(\"SELECT * FROM users WHERE name = '\" + req.query.name + \"'\", (e, rows) => res.json(rows));\n 3| });\n```"}
],
"temperature": 0, "max_tokens": 400,
"chat_template_kwargs": {"enable_thinking": false}
}'
答えは {"vulnerable": true, "cwe": "CWE-89", "location": "routes/user.js:2", "source": ..., "sink": ..., "missing_check": ..., "reason": ...} のような JSON です。ファイル全体を見るときは、120行ほどずつに区切って順に見せてください。
2. エージェントとして使う
評価では、次の system プロンプトと、読み取り専用の4つの道具(OpenAI 互換の tools)で動かしました。
system プロンプト:
You are a careful security code reviewer working as an agent in a read-only checkout of a repository. You can only read files; you cannot run code. Use the tools to inspect the code, follow where inputs come from when needed, and finish by calling `report` exactly once.
道具:
list_dir(path):ディレクトリの中身read_file(path, start_line, end_line):行番号付きで最大150行grep(pattern, path):文字列の検索report(vulnerable, cwe, location, reason):結果の報告
コードを実行する道具や、書き込む道具は渡さないでください。
利用上の注意
- 他人のシステムへの攻撃に使うことは認めません
- 攻撃コードの頼みを断るように学習していますが、完全ではありません
- 誤検出・見落としがあります。セキュリティの判断にこのモデルの出力だけを使わないでください
ライセンス
Apache License 2.0(土台の Spark-X2.6-4B と同じ。学習データの帰属などは 元のリポジトリ を参照)。