wagmi-coder:7b
qwen2.5-coder:7b速度与准确度平衡
日常 PR 与 CI 的默认模型,擅长 hooks、配置与 TypeScript/React 模式。
Wagmi AI 是一组专注于 Wagmi、viem 与现代 React dApp 架构的开源 LLM。通过 Ollama 在本机运行,仓库保持私密,并以结构化 JSON 返回 hook 修复、配置审查与连接器建议。
❯ curl -s -X POST https://wagmiai.dev/api/wagmi -H "Content-Type: text/plain" --data-binary @useSwap.tsx | jq .report
⠿ wagmi-coder:7b 分析中… 186 lines · 3.1s
HIGHuseWriteContract 缺少 chainId 校验L24
MEDIUM切换钱包后数据陈旧 — 缺少 queryKeyL41
LOW写入前建议使用 useSimulateContractL52
quality_score: 88 / 100
支持技术
Models
每个模型均以 Ollama Modelfile 形式提供 — 在成熟开源代码 LLM 上叠加 Wagmi 系统提示与调参。
速度与准确度平衡
日常 PR 与 CI 的默认模型,擅长 hooks、配置与 TypeScript/React 模式。
逐步追踪流程
逐步分析钱包事件、RPC 错误与多 hook 状态,适合不稳定的主网问题。
生产级架构审查
大型应用旗舰模型:SSR、多链、账户抽象与连接器边界情况。
笔记本也能轻松运行
快速初扫与学习,适合编辑器保存时即时检查。
* 准确度与速度为模型间相对比较的参考值,实际表现取决于硬件与代码库。
How it works
无需云 API 密钥,无按量计费。终端 → Ollama → dApp 审查报告,仅此而已。
用 curl 发送 .tsx、.ts 或 wagmi 配置。支持本地 Ollama (:11434) 或本站 /api/wagmi 代理。
curl --data-binary @app.tsx
Ollama 在 GPU/CPU 上运行 Wagmi 模型,系统提示按清单检查 hooks、链与 viem 调用。
ollama · temperature 0.15
包含严重级别、位置、Wagmi 模式 ID 与修复建议的结构化 JSON,便于 jq、CI 与看板。
format: "json"
Why local AI
Wagmi AI 是上主网前的第一道防线 — 在开发循环中捕获链配置错误、损坏的 hooks 与连接器失误。
未发布的 dApp 代码也可放心分析,推理仅在本地 Ollama 中进行。
无 token 计费,每次提交、每个文件都可零成本审查。
Ollama JSON 模式返回稳定 schema,自动化更轻松。
配合 curl 与 jq,可在发现严重 Wagmi 配置问题时使构建失败。
Quick start · curl
选择模型与系统后,下方 curl 命令会自动更新。按顺序复制,接入编辑器、脚本或 CI 即可。
选择模型
安装本地 LLM 运行时 Ollama。安装后后台在 :11434 端口运行。
curl -fsSL https://ollama.com/install.sh | sh
# If the server isn't running: ollama serve
ollama --version
curl -s http://localhost:11434/api/tags | headwagmi-coder:7b 基于 qwen2.5-coder:7b(4.7 GB)构建。
ollama pull qwen2.5-coder:7b用 curl 下载 Modelfile(Wagmi 系统提示与参数)并注册为 Ollama 模型。
curl -fsSL https://wagmiai.dev/api/modelfile/wagmi-coder-7b -o wagmi-coder-7b.Modelfile
ollama create wagmi-coder:7b -f wagmi-coder-7b.Modelfile
ollama list | grep wagmi向 Ollama /api/generate 发送短代码。format: "json" 保证结构化报告。
curl http://localhost:11434/api/generate -d '{
"model": "wagmi-coder:7b",
"prompt": "Review this Wagmi hook for chainId and simulation issues:\n\nexport function useBad() { ... }",
"stream": false,
"format": "json"
}' | jq .使用 jq -Rs 将文件内容安全包装后管道到 /api/chat。
jq -Rs --arg model "wagmi-coder:7b" '{
model: $model,
stream: false,
format: "json",
messages: [{ role: "user", content: . }]
}' src/useSwap.tsx | curl -s http://localhost:11434/api/chat -d @- | jq -r '.message.content' | jq .npm run dev 启动本站后,/api/wagmi 代为调用 Ollama,无需 JSON 转义。
curl -s -X POST "https://wagmiai.dev/api/wagmi?model=wagmi-coder:7b" \
-H "Content-Type: text/plain" \
--data-binary @src/useSwap.tsx | jq .reportLive example
使用 wagmi-coder:7b 审查缺少 chain 守卫与陈旧余额读取的 swap 组件。
import { useAccount, useReadContract, useWriteContract } from 'wagmi'
import { erc20Abi } from 'viem'
export function useSwap(token: `0x${string}`) {
const { address } = useAccount()
const { data: balance } = useReadContract({
address: token,
abi: erc20Abi,
functionName: 'balanceOf',
args: [address!],
})
const { writeContract } = useWriteContract()
const swap = () =>
writeContract({
address: token,
abi: erc20Abi,
functionName: 'approve',
args: ['0xRouter...', balance ?? 0n],
})
return { balance, swap }
}{
"model": "wagmi-coder:7b",
"report": {
"quality_score": 88,
"findings": [
{
"severity": "high",
"title": "Missing chainId on writeContract",
"line": 24,
"pattern": "wagmi/write-chain-guard",
"recommendation": "Pass chainId from useChainId() or use useWriteContract({ mutation: { onError } }) with simulate first."
},
{
"severity": "medium",
"title": "Stale balance after wallet switch",
"line": 11,
"pattern": "tanstack/query-key-account",
"recommendation": "Include address and chainId in TanStack Query key via wagmi's queryKey helper."
}
]
}
}Coverage
从 hook 误用到连接器配置、多链路由与 viem 类型,一次完成。
连接器状态、重连与 SSR 注水
ABI 类型、enabled 与区块/tag 新鲜度
模拟、chainId 与 receipt 轮询
监听器清理与多链过滤
chains、transports 与 SSR cookie
Project ID、元数据与深链
Wagmi hooks 与 viem multicall
RPC 错误、用户拒绝与 revert 数据
切换链/账户后的 queryKey 设计
Mock 连接器与 hook 测试
多余 refetch 与缓存调优
交易预览与地址校验
API reference
直接调用 Ollama (http://localhost:11434),或使用 Wagmi AI 代理简化请求。
接收 TS/TSX 源码,经 Ollama 审查后返回 JSON 报告
Wagmi AI可用模型与 Modelfile 下载地址
Wagmi AI供 ollama create 使用的 Modelfile (text/plain)
Wagmi AI对话请求 — 在 messages 中传入源码
Ollama单提示请求 — 测试短片段
OllamaJSON 请求体示例
curl -s http://localhost:11434/api/chat -d '{
"model": "wagmi-coder:7b",
"stream": false,
"format": "json",
"messages": [
{
"role": "user",
"content": "Review this Wagmi React component for hook and viem best practices.\n\n<file contents>"
}
]
}' | jq -r '.message.content' | jq .CI 流水线门禁
#!/usr/bin/env bash
set -euo pipefail
MODEL="wagmi-coder:7b"
for f in src/**/*.tsx; do
report=$(curl -sf -X POST "$SITE/api/wagmi?model=$MODEL" \
-H "Content-Type: text/plain" --data-binary @"$f" | jq -r '.report.quality_score')
if [[ "$report" -lt 70 ]]; then
echo "Wagmi review failed for $f (score $report)"
exit 1
fi
doneFAQ
AI 分析仅供参考,不能替代专业安全审查。Wagmi 与 Ollama 为各自所有者的商标。
© 2026 Wagmi AI