关于 IndieML Substance API
IndieML Substance API 为处理大量文本的团队评估文本的实质性、深度和清晰度。它提供 REST、Python 和 Node.js 接口,并通过 MCP 端点支持 Agent 集成。
主要功能
- 01评估单条文本
- 02批量评估最多 100 条文本
- 03提供 REST API、Python 和 Node.js SDK
- 04提供托管 MCP 端点
适用场景
- 01为收到的支持工单和报告分类
- 02在表单中提示补充缺失信息
- 03在生成嵌入前过滤低价值文本
- 04排列反馈优先级或整理文本数据集
MCP 相关
托管的 Substance API 可通过 https://indieml.app/mcp/ 向 MCP 客户端提供服务,并使用 API 密钥验证。需要 stdio 的客户端可通过 mcp-remote 桥接连接。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://indieml.app/mcp/claude mcp add --transport http ezchx-indieml https://indieml.app/mcp/{"mcpServers":{"ezchx-indieml":{"type":"http","url":"https://indieml.app/mcp/"}}}在 Cursor 中打开{"servers":{"ezchx-indieml":{"type":"http","url":"https://indieml.app/mcp/"}}}在 VS Code 中打开{"mcpServers":{"ezchx-indieml":{"type":"http","url":"https://indieml.app/mcp/"}}}{"mcpServers":{"ezchx-indieml":{"serverUrl":"https://indieml.app/mcp/"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://indieml.app/mcp/需要授权工具
详细介绍
IndieML - Substance API
一款轻量级、基于 Transformer 的 API,可在 25 毫秒内评估文本的实质内容、深度和清晰度,同时达到全尺寸大模型 87% 的准确率。 此软件包提供 REST API、Python SDK 和 MCP 配置详情,可将托管的 Substance API 原生连接到各种应用。 如需了解更多信息(包括申请 API 密钥),请访问 IndieML。
REST API
对于 Python 和 MCP 生态系统之外的集成(例如标准 OpenAI 函数调用、自定义 AI 脚本或原始 HTTP 请求),托管端点接受标准 JSON 负载请求。
单次评估
cURL
curl -X POST https://indieml.app/v1/score/substance \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"input_text": "This is a test run."}'
Python
import requests
url = "https://indieml.app/v1/score/substance"
headers = {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"input_text": "This is a test run."
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Node.js
const response = await fetch('https://indieml.app/v1/score/substance', {
method: 'POST',
headers: {
'X-API-KEY': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input_text: "This is a test run."
})
});
console.log(await response.json());
批量评估
每次请求最多处理 100 个字符串。
cURL
curl -X POST https://indieml.app/v1/score/substance/batch \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_texts": ["This is a test run.", "This is another test run."]
}'
Python
import requests
url = "https://indieml.app/v1/score/substance/batch"
headers = {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"input_texts": ["This is a test run.", "This is another test run."]
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Node.js
const response = await fetch('https://indieml.app/v1/score/substance/batch', {
method: 'POST',
headers: {
'X-API-KEY': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input_texts: ["This is a test run.", "This is another test run."]
})
});
console.log(await response.json());
Python SDK
安装(需要 Python 3.11 或更高版本)
pip install indieml
用法
from indieml import Substance
# Initialize the API
api = Substance(api_key="YOUR_API_KEY_HERE")
# Single string
single_result = api.score("This is a test run.")
print(single_result)
# Array of strings
batch_result = api.score_batch([
"This is a test run.",
"This is another test run."
])
print(batch_result)
Node SDK
安装
npm install indieml
用法(CommonJS)
const { IndieML } = require('indieml');
// Initialize the API
const api = new IndieML({ apiKey: 'YOUR_API_KEY_HERE' });
// Evaluate a single string
const singleResult = await api.score("This is a test run.");
console.log(singleResult);
// Evaluate an array of strings (automatically chunks into batches of 100)
const batchResult = await api.scoreBatch(["This is a test run.", "This is another test run."])
console.log(batchResult)
用法(ES Modules / TypeScript)
import { IndieML } from 'indieml';
// Initialize the API
const api = new IndieML({ apiKey: 'YOUR_API_KEY_HERE' });
// Evaluate a single string
const singleResult = await api.score("This is a test run.");
console.log(singleResult);
// Evaluate an array of strings (automatically chunks into batches of 100)
const batchResult = await api.scoreBatch(["This is a test run.", "This is another test run."])
console.log(batchResult)
MCP 服务集成
你可以将 Substance API 接入 AI 编码助手,通过将它们路由到我们的云原生 ASGI 端点。
Cursor、ChatGPT 和 Claude Code(Streamable HTTP)
对于支持原生 Streamable HTTP / SSE 配置的 Agent,直接提供远程 URL 和授权标头:
{
"mcpServers": {
"indieml": {
"type": "http",
"url": "https://indieml.app/mcp/",
"headers": {
"X-API-Key": "YOUR_API_KEY_HERE"
}
}
}
}
Claude Desktop(通过 npx Bridge 使用 stdio)
对于需要 stdio 传输的本地 Linux、Mac 和 Windows 客户端,请使用 npx mcp-remote bridge 将连接路由到云端点。需要 Node.js v20+。确保操作系统环境变量中包含 INDIEML_API_KEY。
{
"mcpServers": {
"indieml": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://indieml.app/mcp/",
"--header",
"X-Api-Key:${INDIEML_API_KEY}"
],
"env": {
"INDIEML_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
应用与用例
Substance API 是一款快速、低成本的预筛选工具,旨在与现有筛选器集成。
虽然它可以评估任何文本的实质内容,但尤其适用于高流量的自动化数据管道:
收件箱与接收分流
在人类打开支持工单、共享邮箱、潜在客户表单和错误报告之前为其评分。自动向含糊的一句话消息请求缺失的详细信息,并优先处理详细且可执行的消息。可作为 API 调用、邮件标头,或你现有工具中的标签使用。
Salesforce 集成指南
Zendesk 集成指南
实时输入指导
在内容源头发现信息单薄的提交。在表单、列表和错误报告工具中加入 IndieML,在用户输入过程中提示他们补充缺失内容。团队首次收到的就是完整、可用的输入,无需再追问。
反馈与评价分流
从“很棒的应用”和“它坏了”这类内容中筛选出真正有价值的信息。对问卷回复、NPS 评论和应用评价进行实时评分,然后将详细且可复现的反馈转发到 Jira、Linear 或 Slack,避免泛泛的噪声干扰。
大模型上下文与 RAG 筛选
别再为噪声支付 token 费用。在内容到达嵌入模型或提示词之前,预先筛选抓取的网页、工具输出和文档片段,剔除菜单、模板化内容和占位文本。降低成本、加快调用速度、提升回答质量。
数据集整理
无需支付大模型评审费用,即可对大型文本集合进行排序和筛选。构建微调数据集、清理抓取的语料库,并通过保留高实质内容文本、剔除填充内容来汇编评估集,支持批量和大规模处理。
内容与输出质量
在社区和信息流中凸显最有实质内容的回答、评论和评价,或在 CI 和生产环境中监控聊天机器人及 Agent 的回复是否空洞。对于任何重视深度的文本,都使用一致的评分。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。