跳到正文
AI 工具1 credit

list_ollama_models

发现辅助工具,列出本地 Ollama 实例上可用的模型。用它来找出可传给 extract_with_llm 的模型,以进行私密的设备端 LLM 提取。每次调用 1 credit。

使用场景

发现可用模型

在启动提取任务之前,列出已拉取到本地 Ollama 实例中的每个模型。

验证 Ollama 配置

快速确认你的 Ollama 服务器可达,并正在提供你期望的模型。

搭配 extract_with_llm

以编程方式从此列表中选取一个模型名称,并直接传给 extract_with_llm。

Endpoint

POST/api/v1/tools/list_ollama_models
Auth Required
Free 计划 1 req/s
1 credit

参数

请求示例

cURL

terminalBash
curl -X POST https://crawlforge.dev/api/v1/tools/list_ollama_models \
  -H "X-API-Key: cf_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

TypeScript

listOllamaModels.tsTypescript
// npm install crawlforge-sdk
import { CrawlForge } from 'crawlforge-sdk';

const client = new CrawlForge({ apiKey: process.env.CRAWLFORGE_API_KEY });

const result = await client.listOllamaModels({});

// result.data is untyped in crawlforge-sdk 0.1 — its shape is the Response Example below.
const { models } = result.data as { models: { name: string; size: number }[] };
for (const model of models) {
  console.log(model.name, model.size);
}

Python

list_ollama_models.pyPython
# pip install crawlforge
from crawlforge import CrawlForge

client = CrawlForge()  # reads CRAWLFORGE_API_KEY

result = client.list_ollama_models()

# result.data is a plain dict — its shape is the Response Example below.
for model in result.data['models']:
    print(model['name'], model['size'])

响应示例

200 OK0.2s
{
"success": true,
"data": {
"base_url": "http://localhost:11434",
"count": 3,
"models": [
{
"name": "llama3.1:8b",
"size": 4700000000,
"modified_at": "2026-04-20T10:00:00Z",
"digest": "sha256:abc123..."
},
{
"name": "qwen2.5:7b",
"size": 4400000000,
"modified_at": "2026-04-15T08:30:00Z",
"digest": "sha256:def456..."
},
{
"name": "mistral:7b",
"size": 4100000000,
"modified_at": "2026-03-30T12:15:00Z",
"digest": "sha256:123456..."
}
]
},
"credits_used": 1,
"credits_remaining": 999,
"processing_time": 215
}
Field Descriptions
data.base_url被查询的 Ollama 实例
data.count返回的模型数量
data.models已安装模型的数组,包含 name、size(字节)、modified_at 和 digest
credits_used每次调用扣除 1 credit

credit 费用

1 credit
每次调用 1 credit
每次调用 1 credit。低成本的发现辅助工具。

提示: 如果你在每次提取时都调用此工具,可在客户端缓存响应 —— 模型列表在请求之间很少变化。

相关工具