Token导航 LogoToken导航

Agent Skill · 研究检索

modelmix(modelmix 搜索)

modelmix 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

modelmix 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 56,979。

总安装 444周安装 17GitHub Stars 2下载 140核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:modelmix(modelmix 搜索)
来源仓库:https://github.com/clasen/modelmix
仓库路径:skills/modelmix
安装命令:
npx skills add https://github.com/clasen/modelmix --skill modelmix
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/clasen/modelmix --skill modelmix

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。通过 npx skills add 命令从指定仓库安装,需确认权限和维护状态。涉及联网、命令执行或文件读写时,应先评估安全风险和操作边界。建议结合原始 README 核验具体用法和功能细节。

来源仓库内路径:skills/modelmix

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/clasen/modelmix --skill modelmix;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

modelmix 怎么安装?

在终端执行 npx skills add https://github.com/clasen/modelmix --skill modelmix。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

modelmix 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

modelmix 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

modelmix 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

modelmix 用的人多吗?

公开数据是累计安装 444 次,近一周安装 17 次,下载 140 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

modelmix 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
modelmix

modelmix 搜索 · 本页

4442调用外部服务未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

ModelMix Library Skill

Overview

ModelMix is a Node.js library providing a unified fluent API to interact with multiple AI LLM providers. It handles automatic fallback between models, round-robin load balancing, structured JSON output, streaming, MCP tool integration, custom local tools, rate limiting, and token tracking.

Use this skill when:

  • Integrating one or more AI models into a Node.js project
  • Chaining models with automatic fallback or round-robin
  • Extracting structured JSON from LLMs
  • Adding MCP tools or custom tools to models
  • Streaming responses from any provider
  • Working with templates and file-based prompts
  • Tracking token usage and costs

Do NOT use for:

  • Python or non-Node.js projects
  • Direct HTTP calls to LLM APIs (use ModelMix instead)

Quick Reference

Installation

npm install modelmix

Core Concepts

Import

import { ModelMix } from 'modelmix';

Creating an Instance

const model = ModelMix.new();

const model = ModelMix.new({
    options: { max_tokens: 4096, temperature: 0.7 },
    config: {
        system: "You are a helpful assistant.",
        max_history: 5,   // -1 = unlimited, 0 = none (default), N = keep last N
        debug: 0,          // 0=silent, 1=minimal, 2=summary, 3=full, 4=verbose
        roundRobin: false  // false=fallback, true=rotate models
    }
});

Attaching Models

Chain shorthand methods to attach providers. First model is primary; others are fallbacks (or rotated if roundRobin: true):

const model = ModelMix.new()
    .sonnet46()        // primary
    .gpt52()           // fallback 1
    .gemini3flash()    // fallback 2
    .addText("Hello!")

If sonnet46 fails, it automatically tries gpt52, then gemini3flash.

Available Model Shorthands

OpenAI

gpt52() gpt52chat() gpt51() gpt5() gpt5mini() gpt5nano() gpt45() gpt41() gpt41mini() gpt41nano() o3() o4mini()

Anthropic

opus46() opus45() opus41() sonnet46() sonnet45() sonnet4() haiku45() haiku35()

Thinking variants: append think — e.g. opus46think() sonnet46think() sonnet45think() sonnet4think() opus45think() opus41think() haiku45think()

Google

gemini3pro() gemini3flash() gemini25pro() gemini25flash()

Grok

grok4() grok41() grok41think() grok3() grok3mini()

Perplexity

sonar() sonarPro()

Groq

scout() maverick()

Together

qwen3() kimiK2() kimiK2think() kimiK25think() gptOss()

MiniMax

minimaxM25() minimaxM21() minimaxM2() minimaxM2Stable()

Fireworks

deepseekV32() GLM5() GLM47()

Cerebras

GLM46()

OpenRouter

GLM45()

Multi-provider (auto-fallback across free/paid tiers)

deepseekR1() hermes3() scout() maverick() kimiK2() GLM47()

Local

lmstudio() — for LM Studio local models

Each method accepts optional {options, config} to override per-model settings.

Common Tasks

Get a text response

const answer = await ModelMix.new()
    .gpt5mini()
    .addText("What is the capital of France?")
    .message();

Get structured JSON

const result = await ModelMix.new()
    .gpt5mini()
    .addText("Name and capital of 3 South American countries.")
    .json(
        { countries: [{ name: "", capital: "" }] },
        { countries: [{ name: "country name", capital: "in uppercase" }] },
        { addNote: true }
    );

json() signature: json(schemaExample, schemaDescription?, {addSchema, addExample, addNote}?)

Enhanced descriptors

Descriptions can be strings or descriptor objects with metadata:

const result = await model.json(
    { name: 'martin', age: 22, sex: 'Male' },
    {
        name: { description: 'Name of the actor', required: false },
        age: 'Age of the actor',
        sex: { description: 'Gender', enum: ['Male', 'Female', null] }
    }
);

Descriptor properties: description (string), required (boolean, default true — if false, field becomes nullable), enum (array — if includes null, type auto-becomes nullable), default (any).

Array auto-wrap

Top-level arrays are auto-wrapped as {out: [...]} for better LLM compatibility, and unwrapped on return:

const result = await model.json([{ name: 'martin' }]);
// result is an array: [{ name: "Martin" }, { name: "Carlos" }, ...]

Stream a response

await ModelMix.new()
    .gpt5mini()
    .addText("Tell me a story.")
    .stream(({ delta, message }) => {
        process.stdout.write(delta);
    });

Extract a code block

const code = await ModelMix.new()
    .gpt5mini()
    .addText("Write a hello world function in JavaScript.")
    .block();
// Returns only the content inside the first code block

block() accepts {addSystemExtra} (default true) — adds system instructions that tell the model to wrap output in a code block.

Get raw response

const raw = await ModelMix.new()
    .sonnet45think()
    .addText("Solve this step by step: 2+2*3")
    .raw();
// raw.message, raw.think, raw.tokens, raw.toolCalls, raw.response

Access full response with lastRaw

After calling message(), json(), block(), or stream(), use lastRaw to access the complete response:

const model = ModelMix.new().gpt5mini().addText("Hello!");
const text = await model.message();
console.log(model.lastRaw.tokens);
// { input: 122, output: 86, total: 541, cost: 0.000319, speed: 38 }
console.log(model.lastRaw.think);    // reasoning content (if available)
console.log(model.lastRaw.response); // raw API response

Add images

const model = ModelMix.new().sonnet45();
model.addImage('./photo.jpg');                          // from file
model.addImageFromUrl('https://example.com/img.png');   // from URL
model.addImageFromBuffer(imageBuffer);                  // from Buffer
model.addText('Describe this image.');
const description = await model.message();

All image methods accept an optional second argument {role} (default "user").

Templates with placeholders

const model = ModelMix.new().gpt5mini();
model.setSystemFromFile('./prompts/system.md');
model.addTextFromFile('./prompts/task.md');
model.replace({
    '{role}': 'data analyst',
    '{language}': 'Spanish'
});
model.replaceKeyFromFile('{code}', './src/utils.js');
console.log(await model.message());

Round-robin load balancing

const pool = ModelMix.new({ config: { roundRobin: true } })
    .gpt5mini()
    .sonnet45()
    .gemini3flash();

const r1 = await pool.new().addText("Request 1").message();
const r2 = await pool.new().addText("Request 2").message();

MCP integration

const model = ModelMix.new({ config: { max_history: 10 } }).gpt5nano();
model.setSystem('You are an assistant. Today is ' + new Date().toISOString());
await model.addMCP('@modelcontextprotocol/server-brave-search');
model.addText('Use Internet: What is the latest news about AI?');
console.log(await model.message());

Requires BRAVE_API_KEY in .env for Brave Search MCP.

Custom local tools

const model = ModelMix.new({ config: { max_history: 10 } }).gpt5mini();

model.addTool({
    name: "get_weather",
    description: "Get weather for a city",
    inputSchema: {
        type: "object",
        properties: { city: { type: "string" } },
        required: ["city"]
    }
}, async ({ city }) => {
    return `The weather in ${city} is sunny, 25C`;
});

model.addText("What's the weather in Tokyo?");
console.log(await model.message());

Register multiple tools at once:

model.addTools([
    { tool: { name: "tool_a", description: "...", inputSchema: {...} }, callback: async (args) => {...} },
    { tool: { name: "tool_b", description: "...", inputSchema: {...} }, callback: async (args) => {...} }
]);

Manage tools: model.removeTool("tool_a") and model.listTools() → {local, mcp}.

Rate limiting

const model = ModelMix.new({
    config: {
        bottleneck: {
            maxConcurrent: 4,
            minTime: 1000
        }
    }
}).gpt5mini();

Conversation history

const chat = ModelMix.new({ config: { max_history: 10 } }).gpt5mini();
chat.addText("My name is Martin.");
await chat.message();
chat.addText("What's my name?");
const reply = await chat.message();  // "Martin"

max_history: 0 = no history (default), N = keep last N exchanges, -1 = unlimited.

Debug mode

const model = ModelMix.new({
    config: { debug: 2 }  // 0=silent, 1=minimal, 2=summary, 3=full, 4=verbose
}).gpt5mini();

For full debug output, also set: DEBUG=ModelMix* node script.js

Free-tier models

const model = ModelMix.new()
    .gptOss()
    .kimiK2()
    .deepseekR1()
    .hermes3()
    .addText("What is the capital of France?");
console.log(await model.message());

These use providers with free quotas (OpenRouter, Groq, Cerebras). If one runs out of quota, ModelMix falls back to the next.

Multi-provider routing

Some model shorthands register the same model across multiple providers for maximum resilience. Control which providers are enabled via the mix parameter:

const model = ModelMix.new({
    mix: {
        openrouter: true,   // default: true
        cerebras: true,      // default: true
        groq: true,          // default: true
        together: false,     // default: false
        lambda: false,       // default: false
        minimax: false,      // default: false
        fireworks: false     // default: false
    }
}).deepseekR1();

Agent Usage Rules

  • Check package.json for modelmix before running npm install.
  • Use ModelMix.new() static factory (not new ModelMix()).
  • Store API keys in .env and load with dotenv/config or process.loadEnvFile(). Never hardcode keys.
  • Chain models for resilience: primary model first, fallbacks after.
  • When using MCP tools or addTool(), set max_history to at least 3 — tool call/response pairs consume history slots.
  • Use .json() for structured output instead of parsing text manually. Use descriptor objects {description, required, enum, default} for richer schema control.
  • Use .message() for simple text, .raw() when you need tokens/thinking/toolCalls.
  • For thinking models, append think to the method name (e.g. sonnet45think()).
  • Template placeholders use {key} syntax in both system prompts and user messages.
  • The library uses CommonJS internally but supports ESM import via {ModelMix}.
  • GPT-5+ models automatically use max_completion_tokens instead of max_tokens.
  • o-series models (o3, o4mini) automatically strip max_tokens and temperature since those APIs don't support them.
  • addText(), addImage(), addImageFromUrl(), and addImageFromBuffer() all accept {role} as second argument (default "user").

API Quick Reference

MethodReturnsDescription
.addText(text, {role?})thisAdd user message
.addTextFromFile(path, {role?})thisAdd user message from file
.setSystem(text)thisSet system prompt
.setSystemFromFile(path)thisSet system prompt from file
.addImage(path, {role?})thisAdd image from file
.addImageFromUrl(url, {role?})thisAdd image from URL or data URI
.addImageFromBuffer(buffer, {role?})thisAdd image from Buffer
.replace({})thisSet placeholder replacements
.replaceKeyFromFile(key, path)thisReplace placeholder with file content
.message()Promise<string>Get text response
.json(example, desc?, opts?)`Promise<object\array>`Get structured JSON
.raw()Promise<{message, think, toolCalls, tokens, response}>Full response
.lastRaw`object \null`Full response from last call
.stream(callback)PromiseStream response
.block({addSystemExtra?})Promise<string>Extract code block from response
.addMCP(package)PromiseAdd MCP server tools
.addTool(def, callback)thisRegister custom local tool
.addTools([{tool, callback}])thisRegister multiple tools
.removeTool(name)thisRemove a tool
.listTools(){local, mcp}List registered tools
.new()ModelMixClone instance sharing models
.attach(key, provider)thisAttach custom provider

Available Provider Classes

MixOpenAI MixAnthropic MixGoogle MixPerplexity MixGroq MixTogether MixGrok MixOpenRouter MixOllama MixLMStudio MixCustom MixCerebras MixFireworks MixMiniMax MixLambda

Troubleshooting

Model fails with "API key not found" The provider's API key env var is not set. Add it to .env and ensure it loads before ModelMix runs. Each provider looks for its standard env var (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY).

Tool calls not working Set max_history to at least 3. Tool call/response pairs are stored in history and the model needs to see them to complete the conversation loop.

JSON response parsing fails Add {addNote: true} to the json() options — this injects instructions about JSON escaping that prevent common parsing errors. For complex schemas, also try {addExample: true}.

Model returns empty or truncated response Increase max_tokens in options. Default is 8192 but some tasks need more. For GPT-5+ models, max_completion_tokens is used automatically.

Rate limit errors Configure Bottleneck: config: {bottleneck: {maxConcurrent: 2, minTime: 2000}}. This throttles requests to stay within provider limits.

MCP server fails to connect Ensure the MCP package is installed (npm install @modelcontextprotocol/server-brave-search) and required env vars are set. Call addMCP() with await — it's async.

References

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

平台分布

Codex

34.97%
按下载量换算49

Claude

31.54%
按下载量换算44

Cursor

18.62%
按下载量换算26

Gemini CLI

10.23%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills