solaudit-coder:7b
速度と精度のバランス
日常的なPRレビューやCIパイプラインに最適な標準モデル。コード特化のベースモデルによりSolidityの文法理解に優れています。
- ベース
- qwen2.5-coder:7b
- サイズ
- 4.7 GB
- コンテキスト
- 32K
- 推奨環境
- RAM 8GB · GPU任意
ollama create solaudit-coder:7bSolAudit AIは、Solidityのセキュリティ監査に特化したオープンLLMモデル集です。Ollama上であなたのマシンだけで動作するためコードが外部に出ることはなく、リエントランシー・アクセス制御・オラクル操作などの脆弱性をJSONレポートで返します。

❯ curl -s -X POST https://solauditai.dev/api/audit -H "Content-Type: text/plain" --data-binary @Vault.sol | jq .report
⠿ solaudit-coder:7b 解析中… 212 lines · 2.8s
CRITICAL Reentrancy in withdraw() SWC-107 · L16
HIGH tx.origin used for authorization SWC-115 · L22
LOW Missing events for state changes L10, L18
risk_score: 94 / 100
Models
すべてのモデルは、実績あるオープンソースのコードLLMにSolidity監査用のシステムプロンプトとパラメータを組み合わせたOllama Modelfileとして提供されます。
速度と精度のバランス
日常的なPRレビューやCIパイプラインに最適な標準モデル。コード特化のベースモデルによりSolidityの文法理解に優れています。
ollama create solaudit-coder:7b段階的推論による詳細分析
呼び出しフローと状態変化を段階的に推論し、リエントランシーや価格操作などの複合的な脆弱性を見つけ出します。
ollama create solaudit-deep:14bメインネットデプロイ前の最終チェック
大規模プロトコルや複数コントラクトのコードベース向けのフラッグシップモデル。最も低い誤検知率を実現します。
ollama create solaudit-pro:32bノートPCでも軽快に
素早い一次スキャンや学習用途に適した軽量モデル。エディタでの保存時チェックにも最適です。
ollama create solaudit-lite:3b* 精度・速度はモデル間の相対比較のための参考値であり、実際の性能はハードウェアやコードベースによって異なります。
How it works
クラウドのAPIキーも従量課金も不要。ターミナル → Ollama → セキュリティレポート、たった3ステップです。

curlで.solファイルをそのまま送信します。ローカルのOllama API(:11434)とこのサイトの/api/auditプロキシの両方に対応しています。
curl --data-binary @Vault.solOllamaがあなたのGPU/CPUで監査モデルを実行し、システムプロンプトがSWCレジストリに基づくチェックリストでコードを分析します。
ollama · temperature 0.1重大度・位置・SWC ID・修正方法を含む構造化JSONを返すので、jq・CI・ダッシュボードにそのまま連携できます。
format: "json"
Why local AI
SolAudit AIは、専門監査の前段階でよくあるミスを素早く洗い出す第一の防衛線です。開発ループの中で即座にフィードバックを得られます。
未公開のプロトコルコードも安心して分析できます。すべての推論はローカルのOllamaランタイム内でのみ行われます。
トークン課金がないので、コミットごと・ファイルごとに好きなだけ監査してもコストはかかりません。
OllamaのJSONモードで常に同じスキーマのレポートを受け取れます。パースエラーを気にせず自動化できます。
curlとjqさえあれば、GitHub ActionsやGitLab CIでcriticalが見つかった時にビルドを失敗させられます。
Quick start · curl
モデルとOSを選ぶと下のコマンドが自動で切り替わります。コピーして順番に貼り付けるだけです。
ローカルLLMランタイムであるOllamaをインストールします。インストール後、サーバーがバックグラウンドで:11434ポートで自動起動します。
curl -fsSL https://ollama.com/install.sh | sh
# インストール確認 (サーバーが停止している場合: ollama serve)
ollama --version
curl http://localhost:11434/api/versionsolaudit-coder:7b は qwen2.5-coder:7b (4.7 GB) をベースに作られています。
ollama pull qwen2.5-coder:7bcurlでModelfile(監査用システムプロンプト + パラメータ)をダウンロードし、Ollamaモデルとして登録します。
curl -fsSL https://solauditai.dev/api/modelfile/solaudit-coder-7b -o solaudit-coder-7b.Modelfile
ollama create solaudit-coder:7b -f solaudit-coder-7b.Modelfile
ollama list | grep solauditOllamaの/api/generateにコード片を直接送ってみます。format: "json"で構造化されたレポートが保証されます。
curl http://localhost:11434/api/generate -d '{
"model": "solaudit-coder:7b",
"prompt": "contract A { function kill() public { selfdestruct(payable(msg.sender)); } }",
"format": "json",
"stream": false
}' | jq -r '.response | fromjson'jq -Rsでファイル内容を安全にJSON文字列に変換し、/api/chatにパイプします。
jq -Rs '{
model: "solaudit-coder:7b",
stream: false,
format: "json",
messages: [{ role: "user", content: . }]
}' Vault.sol \
| curl -s http://localhost:11434/api/chat -d @- \
| jq -r '.message.content | fromjson'このサイトをnpm run devで起動すると、/api/auditが代わりにOllamaを呼び出します。JSONエスケープなしで.solファイルをそのまま送信できます。
curl -s -X POST "https://solauditai.dev/api/audit?model=solaudit-coder:7b" \
-H "Content-Type: text/plain" \
--data-binary @Vault.sol | jq .
# リアルタイムストリーミング (NDJSON)
curl -N -X POST "https://solauditai.dev/api/audit?model=solaudit-coder:7b&stream=true" \
-H "Content-Type: text/plain" \
--data-binary @Vault.solLive example
典型的なリエントランシーとtx.origin認証のバグが潜むVaultコントラクトを、solaudit-coder:7bで監査した結果です。
入力 · Vault.sol
1// SPDX-License-Identifier: MIT2pragma solidity ^0.8.20;34contract Vault {5 mapping(address => uint256) public balances;6 address public owner;78 constructor() { owner = msg.sender; }910 function deposit() external payable {11 balances[msg.sender] += msg.value;12 }1314 function withdraw() external {15 uint256 amount = balances[msg.sender];16 (bool ok, ) = msg.sender.call{value: amount}("");17 require(ok, "transfer failed");18 balances[msg.sender] = 0;19 }2021 function sweep(address to) external {22 require(tx.origin == owner, "not owner");23 payable(to).transfer(address(this).balance);24 }25}出力 · POST /api/audit
{
"model": "solaudit-coder:7b",
"duration_ms": 2814,
"report": {
"summary": "Vault is exposed to reentrancy and phishing-based owner takeover. Funds can be fully drained.",
"risk_score": 94,
"findings": [
{
"id": "SA-001",
"title": "Reentrancy in withdraw()",
"severity": "critical",
"swc": "SWC-107",
"location": "withdraw() L16-18",
"description": "External call is made before the balance is zeroed, allowing a malicious receiver to re-enter and withdraw repeatedly.",
"recommendation": "Apply Checks-Effects-Interactions: set balances[msg.sender] = 0 before the call, or use ReentrancyGuard."
},
{
"id": "SA-002",
"title": "tx.origin used for authorization",
"severity": "high",
"swc": "SWC-115",
"location": "sweep() L22",
"description": "A contract called by the owner can invoke sweep() and pass the tx.origin check.",
"recommendation": "Replace tx.origin with msg.sender and consider OpenZeppelin Ownable."
},
{
"id": "SA-003",
"title": "Missing events for state changes",
"severity": "low",
"swc": null,
"location": "deposit() L10, withdraw() L18",
"description": "Deposits and withdrawals emit no events, hindering off-chain monitoring.",
"recommendation": "Emit Deposit and Withdraw events."
}
],
"gas_optimizations": ["Declare owner as immutable", "Use custom errors instead of revert strings"]
}
}Coverage
古典的なバグからDeFi特有の攻撃ベクトル、ガス最適化の提案まで、1回のリクエストでチェックします。
外部呼び出し後の状態更新による繰り返し出金
onlyOwnerの欠如、無防備なselfdestruct
信頼できない呼び出し先へのdelegatecall
スポット価格への依存、フラッシュローンによる価格操作
フィッシングコントラクトによる権限奪取
低レベルcallの失敗を無視
uncheckedブロックや0.8未満での算術演算
nonce・chainIdなしの署名再利用
アップグレード可能プロキシのストレージレイアウト衝突
トランザクション順序依存、スリッページ未設定
block.timestamp / blockhash ベースの乱数
無制限ループ、外部呼び出しのrevertによる停止
API reference
Ollama(http://localhost:11434)を直接呼び出すか、SolAuditプロキシ(https://solauditai.dev)でさらに簡単に呼び出せます。
/api/auditSolidityソースを受け取りOllamaで監査し、JSONレポートを返却SolAudit/api/models提供モデル一覧とModelfileのダウンロードURLSolAudit/api/modelfile/:slugollama createで使うModelfile (text/plain)SolAudit/api/chat対話形式のリクエスト — messages配列でコントラクトを渡すOllama/api/generate単一プロンプトのリクエスト — 短いコード片のテスト用Ollama| 名前 | 型 | 場所 | 説明 |
|---|---|---|---|
| code | string | JSONボディ | Solidityソースコード (text/plainの場合はボディ全体) |
| model | string | body · query | 使用するモデル。デフォルトは solaudit-coder:7b |
| stream | boolean | body · query | trueの場合、OllamaのNDJSONストリームをそのまま転送 |
JSONボディでリクエスト
curl -s https://solauditai.dev/api/audit \
-H "Content-Type: application/json" \
-d '{
"model": "solaudit-pro:32b",
"code": "pragma solidity ^0.8.20; contract T { function f() external { selfdestruct(payable(msg.sender)); } }"
}'CIパイプラインゲート
# critical / high の脆弱性があればCIを失敗させる (exit 1)
for f in contracts/*.sol; do
curl -s -X POST "https://solauditai.dev/api/audit" \
-H "Content-Type: text/plain" --data-binary @"$f" \
| jq -e '[.report.findings[] | select(.severity=="critical" or .severity=="high")] | length == 0' \
|| { echo "❌ $f"; exit 1; }
doneFAQ
いいえ。SolAudit AIは開発段階でよくあるミスを素早く洗い出す一次ツールです。LLMには誤検知や見逃しがあり得るため、実際の資金を扱うコントラクトは、必ずSlitherやFoundryのファジングなどの静的・動的解析と、専門監査会社によるレビューを併せて実施してください。
Ollama(localhost:11434)を直接呼び出す場合、コードがあなたのマシンから出ることはありません。/api/auditプロキシを使う場合も、このNext.jsサーバーとOLLAMA_HOSTで指定したOllamaサーバーの間でのみやり取りされます。
はい。OllamaはCPUのみでも動作します。ただし速度が落ちるため、GPUがない場合はsolaudit-lite:3bまたはsolaudit-coder:7bをおすすめします。Apple Silicon MacではMetalアクセラレーションが自動的に適用されます。
はい。リクエストメッセージに "Write description and recommendation in Japanese" のような一文を追加するか、ModelfileのSYSTEMプロンプトの最後に日本語出力のルールを追加して ollama create で再作成してください。
モデルのコンテキスト(16K〜32Kトークン)に収まるようファイル単位で分けて送るのが最も正確です。APIセクションのCIスクリプトのようにcontracts/*.solを繰り返し処理するか、forge flattenの結果をsolaudit-pro:32bに送ってください。
.env.localに OLLAMA_HOST=http://<サーバーIP>:11434 を設定し、サーバー側では OLLAMA_HOST=0.0.0.0 ollama serve で起動してください。外部に公開する場合は、必ずリバースプロキシと認証を追加してください。