NEWPowered by Ollama · Runs 100% locally→

Smart contract audits,
one curl command away

SolAudit AI is a collection of open LLMs specialized in Solidity security auditing. They run on your own machine via Ollama, so your code never leaves it, and they return reentrancy, access control and oracle manipulation findings as a structured JSON report.

An Ollama llama inspecting a Solidity diamond
~/contracts — zsh

❯ curl -s -X POST https://solauditai.dev/api/audit -H "Content-Type: text/plain" --data-binary @Vault.sol | jq .report

⠿ solaudit-coder:7b analyzing… 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

Audit-tuned models
4
Vulnerability classes (SWC)
20+
Code sent to third parties
0 byte
Context tokens
32K
Solidity ^0.8OllamaEthereum / EVMFoundryHardhatOpenZeppelinSWC RegistryQwen2.5-CoderDeepSeek-R1Llama 3.2JSON ReportGitHub ActionsSolidity ^0.8OllamaEthereum / EVMFoundryHardhatOpenZeppelinSWC RegistryQwen2.5-CoderDeepSeek-R1Llama 3.2JSON ReportGitHub Actions

Models

Four audit models for every workflow

Every model ships as an Ollama Modelfile that layers a Solidity audit system prompt and tuned parameters on top of a proven open-source code LLM.

7B
Recommended

solaudit-coder:7b

Balanced speed and accuracy

The default model for everyday PR reviews and CI pipelines. Its code-focused base gives it a strong grasp of Solidity syntax.

Base
qwen2.5-coder:7b
Size
4.7 GB
Context
32K
Recommended
8GB RAM · GPU optional
Accuracy78
Speed88
ollama create solaudit-coder:7b
14B
Reasoning

solaudit-deep:14b

Step-by-step deep analysis

Reasons through call flows and state changes step by step to uncover compound bugs like reentrancy and price manipulation.

Base
deepseek-r1:14b
Size
9.0 GB
Context
32K
Recommended
16GB RAM · 10GB+ VRAM
Accuracy86
Speed58
ollama create solaudit-deep:14b
32B
Most accurate

solaudit-pro:32b

Final check before mainnet

The flagship model for large protocols and multi-contract codebases, with the lowest false-positive rate.

Base
qwen2.5-coder:32b
Size
20 GB
Context
32K
Recommended
32GB RAM · 24GB+ VRAM
Accuracy92
Speed34
ollama create solaudit-pro:32b
3B
Lightweight

solaudit-lite:3b

Light enough for a laptop

A lightweight model for quick first-pass scans and learning. Great for on-save checks in your editor.

Base
llama3.2:3b
Size
2.0 GB
Context
16K
Recommended
4GB RAM · CPU-only OK
Accuracy64
Speed97
ollama create solaudit-lite:3b

* Accuracy and speed are indicative values for comparing models. Real-world performance depends on your hardware and codebase.

How it works

Your code never leaves your machine

No cloud API keys, no usage billing. Terminal → Ollama → security report — that's the whole pipeline.

Pipeline from a terminal through a local LLM to a security report
  1. 01

    Send the contract

    Send your .sol file as-is with curl. Works with the local Ollama API (:11434) or this site's /api/audit proxy.

    curl --data-binary @Vault.sol
  2. 02

    Local LLM inference

    Ollama runs the audit model on your own GPU/CPU while the system prompt walks the code through an SWC Registry checklist.

    ollama · temperature 0.1
  3. 03

    JSON report

    Get structured JSON with severity, location, SWC ID and a fix for every finding — ready for jq, CI and dashboards.

    format: "json"
A llama inspecting Solidity code with a magnifying glass

Why local AI

A llama auditor
guarding your code 24/7

SolAudit AI is your first line of defense, catching common mistakes before a professional audit. Get instant feedback right inside your dev loop.

Complete privacy

Analyze unreleased protocol code with confidence. All inference happens in your local Ollama runtime.

Free & unlimited

No per-token billing, so run audits on every commit and every file at zero cost.

Structured output

Ollama's JSON mode always returns reports in the same schema. Automate without parsing headaches.

CI/CD friendly

With just curl and jq, fail GitHub Actions or GitLab CI builds whenever a critical issue is found.

Quick start · curl

From terminal to first audit in 5 minutes

Pick a model and OS and the commands below update automatically. Just copy and paste them in order.

  1. 1

    Install Ollama

    Install Ollama, the local LLM runtime. Once installed, the server runs in the background on port :11434.

    install.sh
    bash
    curl -fsSL https://ollama.com/install.sh | sh
    
    # Verify the installation (if the server isn't running: ollama serve)
    ollama --version
    curl http://localhost:11434/api/version
  2. 2

    Download the base model

    solaudit-coder:7b is built on qwen2.5-coder:7b (4.7 GB).

    pull.sh
    bash
    ollama pull qwen2.5-coder:7b
  3. 3

    Fetch the Modelfile & create the audit model

    Download the Modelfile (audit system prompt + parameters) with curl and register it as an Ollama model.

    create.sh
    bash
    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 solaudit
  4. 4

    Quick test

    Send a code snippet straight to Ollama's /api/generate. format: "json" guarantees a structured report.

    quick-test.sh
    bash
    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'
  5. 5

    Audit a full .sol file

    jq -Rs safely wraps the file contents in a JSON string and pipes it to /api/chat.

    audit.sh
    bash
    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'
  6. 6

    Use the SolAudit proxy API

    Run this site with npm run dev and /api/audit calls Ollama for you. Send your .sol file as-is — no JSON escaping needed.

    proxy.sh
    bash
    curl -s -X POST "https://solauditai.dev/api/audit?model=solaudit-coder:7b" \
      -H "Content-Type: text/plain" \
      --data-binary @Vault.sol | jq .
    
    # Real-time streaming (NDJSON)
    curl -N -X POST "https://solauditai.dev/api/audit?model=solaudit-coder:7b&stream=true" \
      -H "Content-Type: text/plain" \
      --data-binary @Vault.sol

Live example

Feed it a vulnerable contract, get a report like this

The result of auditing a Vault contract that hides a classic reentrancy bug and tx.origin authentication with solaudit-coder:7b.

Critical1High1Medium0Low1risk_score 94/100

Input · Vault.sol

Vault.sol
solidity
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}

Output · POST /api/audit

response.json
json
{
  "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

Vulnerability detection based on the SWC Registry

From classic bugs to DeFi-specific attack vectors and gas optimization tips — all checked in a single request.

SWC-107critical

Reentrancy

Repeated withdrawals caused by updating state after external calls

SWC-105/106critical

Access Control

Missing onlyOwner, unprotected selfdestruct

SWC-112critical

Delegatecall Injection

delegatecall into untrusted callees

DeFicritical

Oracle Manipulation

Spot price reliance, flash-loan price manipulation

SWC-115high

tx.origin Auth

Privilege takeover through phishing contracts

SWC-104high

Unchecked Call Return

Ignored low-level call failures

SWC-101high

Integer Over/Underflow

Arithmetic in unchecked blocks or pre-0.8 compilers

SWC-121high

Signature Replay

Signature reuse without a nonce or chainId

Proxyhigh

Storage Collision

Storage layout collisions in upgradeable proxies

SWC-114medium

Front-running

Transaction ordering dependence, missing slippage limits

SWC-120medium

Weak Randomness

Randomness derived from block.timestamp / blockhash

SWC-128medium

DoS with Gas Limit

Unbounded loops, halts caused by reverting external calls

API reference

Two endpoints, one schema

Call Ollama (http://localhost:11434) directly, or use the SolAudit proxy (https://solauditai.dev) for an even simpler request.

Endpoints
  • POST/api/auditTakes Solidity source, audits it with Ollama and returns a JSON reportSolAudit
  • GET/api/modelsAvailable models and Modelfile download URLsSolAudit
  • GET/api/modelfile/:slugModelfile for ollama create (text/plain)SolAudit
  • POST/api/chatChat request — pass the contract in the messages arrayOllama
  • POST/api/generateSingle-prompt request — for testing short snippetsOllama
POST /api/audit parameters
NameTypeInDescription
codestringJSON bodySolidity source (the entire body for text/plain requests)
modelstringbody · queryModel to use. Defaults to solaudit-coder:7b
streambooleanbody · queryIf true, Ollama's NDJSON stream is passed through as-is

Request with a JSON body

json-request.sh
bash
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 pipeline gate

ci-audit.sh
bash
# Fail CI (exit 1) if any critical / high issue is found
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; }
done

FAQ

Frequently asked questions

Can an AI audit replace a professional security audit?+

No. SolAudit AI is a first-pass tool for catching common mistakes during development. LLMs can produce false positives and miss issues, so any contract holding real funds should also go through static and dynamic analysis such as Slither and Foundry fuzzing, plus a review by a professional audit firm.

Is my code sent to an external server?+

When you call Ollama (localhost:11434) directly, your code never leaves your machine. When using the /api/audit proxy, it only travels between this Next.js server and the Ollama server configured in OLLAMA_HOST.

Does it run without a GPU?+

Yes. Ollama works on CPU alone, just more slowly — without a GPU we recommend solaudit-lite:3b or solaudit-coder:7b. Apple Silicon Macs get Metal acceleration automatically.

Can I get the report in another language?+

Yes. Add a line such as "Write description and recommendation in Korean" to your request, or append an output-language rule to the SYSTEM prompt in the Modelfile and re-run ollama create.

How do I audit a large project with many contracts?+

Sending one file at a time, within the model's context window (16K–32K tokens), gives the most accurate results. Loop over contracts/*.sol like the CI script in the API section, or send the output of forge flatten to solaudit-pro:32b.

How do I use Ollama on a remote server?+

Set OLLAMA_HOST=http://<server IP>:11434 in .env.local and start the server with OLLAMA_HOST=0.0.0.0 ollama serve. Always put a reverse proxy with authentication in front of it before exposing it publicly.