Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Split a multi-call LM workflow by cognitive load, not by accuracy: let one strong model make the few reasoning decisions and a cheap model do the many mechanical executions (Aider architect+editor, DSPy optimizer-LM vs task-LM, vLLM speculative draft+target, LangGraph supervisor+worker are the same shape).
SkillScore93/100
Test results 86 · Live runs 100
3/3 safety checks passed
41%86%of test cases passed +45 pts
Passed 19 of 22 test cases with the skill, and 9 of 22 without it.
10 fixed9 passed either way3 still failing0 broke
One test taskWe successfully split our pipeline into GPT-4o decision making and GPT-4o-mini execution. Now we want to fine-tune a 1B local model to replace GPT-4o-mini as the cheap executor using teacher traces from GPT-4o. What risk must we mitigate during this transition?
Adds every file the skill has, pinned so you can update it. No account needed.
pip install "decimalai>=0.15"
decimalai skills add agentsope-agentsop-cost-tiered-models
claude --plugin-dir "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.agents"The same install from Python, for a notebook or a setup script.
pip install "decimalai>=0.15"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
print("Added. Start Claude Code with the command below.")claude --plugin-dir "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.agents"Type these in a Claude Code session. No account or API key. It writes the skill and any files it bundles, and asks first when its safety rating isn't Passed.
/plugin marketplace add decimal-labs/decimalai-claude-plugins
/plugin install decimalai@decimalai/decimalai:install agentsope-agentsop-cost-tiered-modelsThe plugin needs python3 and curl on your machine.
No Python or account. Claude Code picks it up in its next session.
curl -fsSL --create-dirs -o .claude/skills/agentsope-agentsop-cost-tiered-models/SKILL.md https://app.decimal.ai/s/agentsope-agentsop-cost-tiered-models/SKILL.md.claude/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdThis gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[claude-agent-sdk]"
decimalai skills add agentsope-agentsop-cost-tiered-modelsimport asyncio
from claude_agent_sdk import ClaudeAgentOptions
from decimalai.claude_agent_sdk import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
async def main():
question = "Hello!"
async with support.run(question) as run: # one user message, one run
async for message in run.query(options=ClaudeAgentOptions(max_turns=6)):
print(message)
# In a notebook or async code: await main()
asyncio.run(main())Prefer its own loader? ClaudeAgentOptions(plugins=[skills_plugin()], skills="all") reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[claude-agent-sdk]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
import asyncio
from claude_agent_sdk import ClaudeAgentOptions
from decimalai.claude_agent_sdk import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
async def main():
question = "Hello!"
async with support.run(question) as run: # one user message, one run
async for message in run.query(options=ClaudeAgentOptions(max_turns=6)):
print(message)
# In a notebook or async code: await main()
asyncio.run(main())Prefer its own loader? ClaudeAgentOptions(plugins=[skills_plugin()], skills="all") reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdimport asyncio
from pathlib import Path
from claude_agent_sdk import ClaudeAgentOptions, query
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
options = ClaudeAgentOptions(system_prompt=f"You are a helpful agent.\n\n{skill}", max_turns=6)
async def main():
async for message in query(prompt="Hello!", options=options):
print(message)
# In a notebook or async code: await main()
asyncio.run(main())This gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai-agents]"
decimalai skills add agentsope-agentsop-cost-tiered-modelsfrom agents import Agent, Runner
from decimalai.openai_agents import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
name=support.name,
instructions=support.instructions, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# In a notebook or async code: result = await Runner.run(agent, "Hello!")
result = Runner.run_sync(agent, "Hello!")Using SandboxAgent? capabilities=[Shell(), decimalai.openai_agents.sandbox_skills()] points its own loader at the same folder.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai-agents]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
from agents import Agent, Runner
from decimalai.openai_agents import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
name=support.name,
instructions=support.instructions, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# In a notebook or async code: result = await Runner.run(agent, "Hello!")
result = Runner.run_sync(agent, "Hello!")Using SandboxAgent? capabilities=[Shell(), decimalai.openai_agents.sandbox_skills()] points its own loader at the same folder.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from agents import Agent, Runner
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
agent = Agent(name="support", instructions=f"You are a helpful agent.\n\n{skill}")
# In a notebook or async code: result = await Runner.run(agent, "Hello!")
result = Runner.run_sync(agent, "Hello!")This gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai]"
decimalai skills add agentsope-agentsop-cost-tiered-modelsimport json
from openai import OpenAI
from decimalai.openai import agent_config
client = OpenAI()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your tools, as Chat Completions takes them, and what answers each.
TOOLS = [{"type": "function", "function": {
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
# run.system is your prompt, then the skill list.
messages = [{"role": "system", "content": run.system}, run.message]
while True:
reply = client.chat.completions.create(
model="gpt-5.4-mini",
messages=messages,
tools=[*TOOLS, *run.tools], # your tools, then load_skill
).choices[0].message
messages.append(reply)
if not reply.tool_calls:
break
for call in reply.tool_calls:
# load_skill is answered by the run; your own tools by FUNCTIONS.
function = FUNCTIONS.get(call.function.name)
messages.append(run.tool_result(call) or {
"role": "tool", "tool_call_id": call.id,
"content": function(**json.loads(call.function.arguments)) if function
else f"There is no tool named {call.function.name!r}.",
})
print(reply.content)
# The Responses API takes run.response_tools instead of run.tools.The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
import json
from openai import OpenAI
from decimalai.openai import agent_config
client = OpenAI()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your tools, as Chat Completions takes them, and what answers each.
TOOLS = [{"type": "function", "function": {
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
# run.system is your prompt, then the skill list.
messages = [{"role": "system", "content": run.system}, run.message]
while True:
reply = client.chat.completions.create(
model="gpt-5.4-mini",
messages=messages,
tools=[*TOOLS, *run.tools], # your tools, then load_skill
).choices[0].message
messages.append(reply)
if not reply.tool_calls:
break
for call in reply.tool_calls:
# load_skill is answered by the run; your own tools by FUNCTIONS.
function = FUNCTIONS.get(call.function.name)
messages.append(run.tool_result(call) or {
"role": "tool", "tool_call_id": call.id,
"content": function(**json.loads(call.function.arguments)) if function
else f"There is no tool named {call.function.name!r}.",
})
print(reply.content)
# The Responses API takes run.response_tools instead of run.tools.No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from openai import OpenAI
client = OpenAI()
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
reply = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[
{"role": "system", "content": f"You are a helpful agent.\n\n{skill}"},
{"role": "user", "content": "Hello!"},
],
).choices[0].messageThis gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[anthropic]"
decimalai skills add agentsope-agentsop-cost-tiered-modelsimport anthropic
from decimalai.anthropic import agent_config
client = anthropic.Anthropic()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
question = "Hello!"
with support.run(question) as run: # one user message, one run
answer = client.beta.messages.tool_runner(
model="claude-haiku-5-5",
max_tokens=4096,
system=run.system, # your prompt, then the skill list
tools=[*run.tools], # your tools, then load_skill
messages=[{"role": "user", "content": question}],
).until_done()The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[anthropic]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
import anthropic
from decimalai.anthropic import agent_config
client = anthropic.Anthropic()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
question = "Hello!"
with support.run(question) as run: # one user message, one run
answer = client.beta.messages.tool_runner(
model="claude-haiku-5-5",
max_tokens=4096,
system=run.system, # your prompt, then the skill list
tools=[*run.tools], # your tools, then load_skill
messages=[{"role": "user", "content": question}],
).until_done()No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
import anthropic
client = anthropic.Anthropic()
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
reply = client.messages.create(
model="claude-haiku-5-5",
max_tokens=4096,
system=f"You are a helpful agent.\n\n{skill}",
messages=[{"role": "user", "content": "Hello!"}],
)This gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[google-genai]"
decimalai skills add agentsope-agentsop-cost-tiered-modelsfrom google import genai
from google.genai import types
from decimalai.google_genai import agent_config
client = genai.Client()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your functions, as declarations for the model, and what answers each.
TOOLS = [{"function_declarations": [{
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters_json_schema": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}]}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
config = types.GenerateContentConfig(
system_instruction=run.system, # your prompt, then the skill list
tools=[*TOOLS, *run.tool_params], # your functions, then load_skill
)
contents = [{"role": "user", "parts": [{"text": run.message}]}]
while True:
response = client.models.generate_content(
model="gemini-3.5-flash", contents=contents, config=config,
)
if not response.function_calls:
break
contents.append(response.candidates[0].content)
parts = []
for call in response.function_calls:
# load_skill is answered by the run; your own functions by FUNCTIONS.
# A loop of your own rather than automatic function calling, which
# raises KeyError when the model asks for a function you did not pass.
function = FUNCTIONS.get(call.name)
parts.append(run.tool_result(call) or {"function_response": {
"name": call.name, "id": call.id,
"response": {"result": function(**(call.args or {})) if function
else f"There is no function named {call.name!r}."},
}})
contents.append({"role": "user", "parts": parts})
print(response.text)The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[google-genai]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
from google import genai
from google.genai import types
from decimalai.google_genai import agent_config
client = genai.Client()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your functions, as declarations for the model, and what answers each.
TOOLS = [{"function_declarations": [{
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters_json_schema": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}]}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
config = types.GenerateContentConfig(
system_instruction=run.system, # your prompt, then the skill list
tools=[*TOOLS, *run.tool_params], # your functions, then load_skill
)
contents = [{"role": "user", "parts": [{"text": run.message}]}]
while True:
response = client.models.generate_content(
model="gemini-3.5-flash", contents=contents, config=config,
)
if not response.function_calls:
break
contents.append(response.candidates[0].content)
parts = []
for call in response.function_calls:
# load_skill is answered by the run; your own functions by FUNCTIONS.
# A loop of your own rather than automatic function calling, which
# raises KeyError when the model asks for a function you did not pass.
function = FUNCTIONS.get(call.name)
parts.append(run.tool_result(call) or {"function_response": {
"name": call.name, "id": call.id,
"response": {"result": function(**(call.args or {})) if function
else f"There is no function named {call.name!r}."},
}})
contents.append({"role": "user", "parts": parts})
print(response.text)No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from google import genai
from google.genai import types
client = genai.Client()
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
response = client.models.generate_content(
model="gemini-3.5-flash",
contents="Hello!",
config=types.GenerateContentConfig(system_instruction=f"You are a helpful agent.\n\n{skill}"),
)This gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[langchain]" langchain-openai
decimalai skills add agentsope-agentsop-cost-tiered-modelsfrom langchain.agents import create_agent
from decimalai.langchain import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = create_agent(
"openai:gpt-5.4-mini",
tools=[], # your tools; the middleware adds load_skill
middleware=[support.middleware], # your prompt, the skill list and load_skill
)
result = agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[langchain]" langchain-openaifrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
from langchain.agents import create_agent
from decimalai.langchain import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = create_agent(
"openai:gpt-5.4-mini",
tools=[], # your tools; the middleware adds load_skill
middleware=[support.middleware], # your prompt, the skill list and load_skill
)
result = agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from langchain.agents import create_agent
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
agent = create_agent("openai:gpt-5.4-mini", tools=[], system_prompt=f"You are a helpful agent.\n\n{skill}")
result = agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})This gets SKILL.md only. The skill's 1 other file is not included.
CrewAI's own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" "crewai>=1.15.27"
decimalai skills add agentsope-agentsop-cost-tiered-modelsimport decimalai.crewai
from crewai import Agent, Crew, Task
agent = Agent(
role="Support", goal="Help the customer", backstory="A support agent.",
llm=llm, # your own CrewAI LLM
skills=decimalai.crewai.skills(), # the installed folder
tools=decimalai.crewai.skill_tools(), # reads a skill's files, runs its scripts
)
task = Task(description="Hello!", expected_output="an answer", agent=agent)
Crew(agents=[agent], tasks=[task]).kickoff()The same install from Python, for a notebook or a setup script. CrewAI's own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" "crewai>=1.15.27"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
import decimalai.crewai
from crewai import Agent, Crew, Task
agent = Agent(
role="Support", goal="Help the customer", backstory="A support agent.",
llm=llm, # your own CrewAI LLM
skills=decimalai.crewai.skills(), # the installed folder
tools=decimalai.crewai.skill_tools(), # reads a skill's files, runs its scripts
)
task = Task(description="Hello!", expected_output="an answer", agent=agent)
Crew(agents=[agent], tasks=[task]).kickoff()No DecimalAI package. CrewAI's own loader reads the folder, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from crewai import Agent, Crew, Task
agent = Agent(
role="Support", goal="Help the customer", backstory="A support agent.",
llm=llm, # your own CrewAI LLM
skills=[Path(".agents/skills")],
)
task = Task(description="Hello!", expected_output="an answer", agent=agent)
Crew(agents=[agent], tasks=[task]).kickoff()This gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[adk]"
decimalai skills add agentsope-agentsop-cost-tiered-modelsfrom decimalai.adk import DecimalAIPlugin, agent_config
from google.adk.agents import LlmAgent
from google.adk.apps import App
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = LlmAgent(
name="support", # ADK needs a Python identifier
model="gemini-3.5-flash",
instruction=support.instruction, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# DecimalAIPlugin makes each invocation of runners built from this App one trace.
app = App(name="support", root_agent=agent, plugins=[DecimalAIPlugin()])Prefer ADK's own loader? SkillToolset(skills=decimalai.adk.skills(), ...) reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[adk]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
from decimalai.adk import DecimalAIPlugin, agent_config
from google.adk.agents import LlmAgent
from google.adk.apps import App
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = LlmAgent(
name="support", # ADK needs a Python identifier
model="gemini-3.5-flash",
instruction=support.instruction, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# DecimalAIPlugin makes each invocation of runners built from this App one trace.
app = App(name="support", root_agent=agent, plugins=[DecimalAIPlugin()])Prefer ADK's own loader? SkillToolset(skills=decimalai.adk.skills(), ...) reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from google.adk.agents import LlmAgent
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
agent = LlmAgent(
name="support",
model="gemini-3.5-flash",
instruction=lambda context: f"You are a helpful agent.\n\n{skill}",
)This gets SKILL.md only. The skill's 1 other file is not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[pydantic-ai]"
decimalai skills add agentsope-agentsop-cost-tiered-modelsfrom pydantic_ai import Agent
from decimalai.pydantic_ai import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
"openai:gpt-4o-mini",
name=support.name,
tools=[], # your tools; the capability adds load_skill
capabilities=[support], # your prompt, the skill list and load_skill
)
# In a notebook or async code: result = await agent.run("Hello!")
result = agent.run_sync("Hello!")On the Pydantic AI harness, decimalai.pydantic_ai_harness.skills(project) uses its own loader instead.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[pydantic-ai]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
from pydantic_ai import Agent
from decimalai.pydantic_ai import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
"openai:gpt-4o-mini",
name=support.name,
tools=[], # your tools; the capability adds load_skill
capabilities=[support], # your prompt, the skill list and load_skill
)
# In a notebook or async code: result = await agent.run("Hello!")
result = agent.run_sync("Hello!")On the Pydantic AI harness, decimalai.pydantic_ai_harness.skills(project) uses its own loader instead.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from pydantic_ai import Agent
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
agent = Agent("openai:gpt-4o-mini", instructions=f"You are a helpful agent.\n\n{skill}")
# In a notebook or async code: result = await agent.run("Hello!")
result = agent.run_sync("Hello!")This gets SKILL.md only. The skill's 1 other file is not included.
Deep Agents' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" deepagents
decimalai skills add agentsope-agentsop-cost-tiered-modelsimport decimalai.deepagents
from deepagents import create_deep_agent
agent = create_deep_agent(model=model, **decimalai.deepagents.skills())
agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})The default backend reads files but has no shell. To run a skill's scripts, pass skills(backend=LocalShellBackend(...)).
The same install from Python, for a notebook or a setup script. Deep Agents' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" deepagentsfrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
import decimalai.deepagents
from deepagents import create_deep_agent
agent = create_deep_agent(model=model, **decimalai.deepagents.skills())
agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})The default backend reads files but has no shell. To run a skill's scripts, pass skills(backend=LocalShellBackend(...)).
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from deepagents import create_deep_agent
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
agent = create_deep_agent(model=model, system_prompt=f"You are a helpful agent.\n\n{skill}")
agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})This gets SKILL.md only. The skill's 1 other file is not included.
Its own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" agent-framework
decimalai skills add agentsope-agentsop-cost-tiered-modelsimport asyncio
from agent_framework import Agent
from decimalai.agent_framework import skills
agent = Agent(client=client, instructions="You are a helpful agent.", context_providers=[skills()])
asyncio.run(agent.run("Hello!"))It caches skills by default, so restart the process after decimalai skills update.
The same install from Python, for a notebook or a setup script. Its own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" agent-frameworkfrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
import asyncio
from agent_framework import Agent
from decimalai.agent_framework import skills
agent = Agent(client=client, instructions="You are a helpful agent.", context_providers=[skills()])
asyncio.run(agent.run("Hello!"))It caches skills by default, so restart the process after decimalai skills update.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdimport asyncio
from pathlib import Path
from agent_framework import Agent
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
agent = Agent(client=client, instructions=f"You are a helpful agent.\n\n{skill}")
asyncio.run(agent.run("Hello!"))This gets SKILL.md only. The skill's 1 other file is not included.
Strands' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" strands-agents
decimalai skills add agentsope-agentsop-cost-tiered-modelsfrom decimalai.strands import skills
from strands import Agent
from strands.vended_tools import file_editor, shell
agent = Agent(
model=model, # always pass one: the default is Amazon Bedrock
system_prompt="You are a helpful agent.",
tools=[file_editor, shell],
plugins=[skills()],
)
agent("Hello!")Strands loads an agent's skills once, so build the agent again after decimalai skills update.
The same install from Python, for a notebook or a setup script. Strands' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" strands-agentsfrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("agentsope-agentsop-cost-tiered-models")
if result.exit_code:
raise SystemExit(result.problems)
from decimalai.strands import skills
from strands import Agent
from strands.vended_tools import file_editor, shell
agent = Agent(
model=model, # always pass one: the default is Amazon Bedrock
system_prompt="You are a helpful agent.",
tools=[file_editor, shell],
plugins=[skills()],
)
agent("Hello!")Strands loads an agent's skills once, so build the agent again after decimalai skills update.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdfrom pathlib import Path
from strands import Agent
skill = Path(".agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md").read_text()
agent = Agent(model=model, system_prompt=f"You are a helpful agent.\n\n{skill}")
agent("Hello!")This gets SKILL.md only. The skill's 1 other file is not included.
Adds every file the skill has, pinned so you can update it. Cursor, Copilot, Cline and Warp read this folder by themselves.
pip install "decimalai>=0.15"
decimalai skills add agentsope-agentsop-cost-tiered-modelsNo Python or account. Cursor, Copilot, Cline and Warp read this folder by themselves.
curl -fsSL --create-dirs -o .agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.md https://app.decimal.ai/s/agentsope-agentsop-cost-tiered-models/SKILL.md.agents/skills/agentsope-agentsop-cost-tiered-models/SKILL.mdThis gets SKILL.md only. The skill's 1 other file is not included.
Give its text to your model as instructions. No account or package needed.
This gets SKILL.md only. The skill's 1 other file is not included.
Raw files: /s/agentsope-agentsop-cost-tiered-models/SKILL.md · /s/agentsope-agentsop-cost-tiered-models.json
Fetch the file and give its text to your model as instructions. No account or package needed.
curl -fsSL https://app.decimal.ai/s/agentsope-agentsop-cost-tiered-models/SKILL.mdcurl -fsSL https://app.decimal.ai/s/agentsope-agentsop-cost-tiered-models.jsonThis gets SKILL.md only. The skill's 1 other file is not included.
You don't need a DecimalAI account.
Saved prompts and skills, pinned versions, and traces of this skill in your runs. DecimalAI does not run your agent.
Claude Code reads files from your project, so DecimalAI config does not apply there.
On Claude Agent SDK: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On OpenAI Agents: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On OpenAI SDK: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Anthropic: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Gemini API: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On LangChain: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On CrewAI: set DECIMAL_API_KEY and add decimalai.init(crewai=True) to record runs and skill use. The skill version stays in your repo.
On Google ADK: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Pydantic AI: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Deep Agents: set DECIMAL_API_KEY and add decimalai.init(langchain=True) to record runs and skill use. The skill version stays in your repo.
On Microsoft Agent Framework: set DECIMAL_API_KEY and add decimalai.init(otel=True, agent_name="support") to record runs and skill use. The skill version stays in your repo.
On Strands: set DECIMAL_API_KEY and add decimalai.init(otel=True, agent_name="support") to record runs and skill use. The skill version stays in your repo.
Editors read files from your project, so DecimalAI config does not apply there.
Anywhere else: record a use with decimalai.log_skill_activation() inside a trace.
一句话:一条多次调用 LM 的工作流里,少数调用需要推理,多数调用是机械执行。让一个强模型做决策,让一个便宜模型干活——按认知负荷拆分,不是按"哪个更准"拆分。
统一声明:Phase B 发现这个模式在 4 个 SOP 里以 4 个名字反复出现——DSPy 的 optimizer-LM vs task-LM、Aider 的 architect+editor、vLLM 的 speculative draft+target、LangGraph 的 supervisor+worker。它们是同一个形状。本技能把这个形状抽出来,命名为 cost-tiered models。详见 §7 跨框架对照。
任一情形成立时激活本技能:
不应激活(见 §6):
按认知负荷拆分:一个强模型做决策,一个便宜模型执行——而且绝大多数调用是执行。
绝大多数团队的默认是"全程一个模型"。这把两种本质不同的工作混在了一个价位上:
| 层 | 工作性质 | 调用频率 | 模型要求 | 选谁 |
|---|---|---|---|---|
| Tier-S(决策层) | 规划、推理、路由、判断、提案 | 少(每任务 1–N 次) | 推理强;执行干不干净不重要 | 最强 reasoner |
| Tier-E(执行层) | 改写、抽取、格式化、应用决定、生成草稿 | 多(占总调用 80%+) | 听话、格式干净、便宜、快 | 便宜/快模型 |
关键洞察:成本由调用次数主导,调用次数由执行层主导。所以把执行层降级到便宜模型,省下大部分成本,却几乎不碰决策质量——因为决策层调用次数少,仍然用最强模型。
推理能力和指令依从(产出干净的 diff/JSON/格式)是两种不同的能力,不总同向。Aider 的 Polyglot 数据是最干净的证据:o1-preview 单独跑 79.7%,但它当 architect 配一个便宜 editor 后,整体到 82.7%–85%——两次便宜的专门调用胜过一次又贵又全能的调用 [aider.chat/2024/09/26/architect.html]。强模型负责"想",便宜模型负责"把想法落成格式正确的编辑"。
三者都是"强决策 + 廉价执行"的拆分,只是优化目标不同。
拆分不是单向的。便宜执行者会在某些输入上失败或退化(格式错、跑题、质量塌)。正确的设计带一个回退-升级阀门:检测到执行层失败 → 把这一步升级到强模型重试。便宜执行者覆盖 80–95% 的常规输入,强模型兜底长尾。这把"省钱"和"不掉质量"同时拿到。
[Step 0] 列出工作流里所有 LM 调用
└─ 对每次调用记:它在"想"还是在"做"?预期调用频率?
[Step 1] 给每次调用打认知负荷标签
├─ 高推理(规划/路由/判断/提案/纠错) → 候选 Tier-S
└─ 机械执行(改写/抽取/格式化/应用决定/草稿) → 候选 Tier-E
规则:把"需要全局判断 / 一旦错代价高 / 频率低"的归 Tier-S,
其余尽量下沉到 Tier-E。
[Step 2] 分配模型层
├─ Tier-S → 你能负担的最强 reasoner(少量调用,单价高无所谓)
├─ Tier-E → 便宜/快模型(大量调用,单价主导总成本)
└─ 给 Tier-E 选最适配它的输出格式(弱模型用 whole/简单 schema,
不要逼它产 token 高效但易错的 diff)。
[Step 3] 度量质量 delta(必须做,否则是赌博)
├─ baseline:全程强模型的质量分 + 成本
├─ split:S+E 拆分后的质量分 + 成本
├─ 看 (质量 delta, 成本 delta) 这一对,不要只看其一
└─ 在你自己的真实任务上量,不要信别人 benchmark 的绝对数
[Step 4] 装升级阀门
├─ 定义"执行层失败"的可检测信号(格式不合法 / 测试不过 /
│ schema 校验失败 / 自评分低)
├─ 失败 → 升级到 Tier-S 重试这一步(或换执行格式重试)
└─ 记录升级率:若 >30%,说明这步本就属于 Tier-S,重新归类
[Step 5] 调拆分点(tune the split)
├─ 升级率高 / 质量掉太多 → 把更多步上移到 Tier-S
├─ 升级率近 0 / 质量持平 → 把更多步下沉到 Tier-E,再省一截
└─ 拆分点是个滑块,不是开关;按 Step 3 的数往返调
editor-diff/editor-whole)。BootstrapFinetune(student=Llama-3.2-1B, teacher=gpt-4o-mini),先在大模型优化再蒸馏 [dspy SKILL §4.1]。警告:换 task-LM 家族必须重编译/重测,大模型的 verbose CoT demo 会让小模型"鹦鹉学舌长度而无推理" [dspy SKILL Case B]。触发:硬推理编码任务;你有 o1/o3(强 reasoner,但单独跑编辑脏)。开 architect 等于把每个任务从 1 次调用变 2 次,token 成本接近翻倍。
张力:
决策规则:
| 情况 | 建议 |
|---|---|
| reasoner 执行也干净(GPT-4o / Sonnet 单跑) | 不开 architect,单跑省钱省时 |
| reasoner 执行差(o1/o3 单跑格式脏) | 开 architect:强 reasoner + 便宜干净 editor → +3pp~+5pp |
| 追 SOTA、能等慢 | o1-preview + o1-mini(whole) → 85%("probably not practical for interactive use") |
| 例行/低价值编辑 | 单跑,别拆 |
可提取操作:拆分的收益 = (质量 delta) × (任务价值) − (额外调用成本)。reasoner 执行已干净时 delta≈0,不拆;reasoner 执行差时 delta 大,拆。
Evidence: [aider.chat/2024/09/26/architect.html]。
触发:Tier-E 用便宜模型干活,部分输入上质量明显塌(代码改错、抽取漏字段、格式反复非法),但多数输入仍正常。是把整层换回强模型,还是只升级失败的那部分?
张力:
决策规则:
可提取操作:升级率是拆分点是否放对的体温计。它不是要清零,而是要稳定在低位;持续高升级率 = 拆分点划错了。
Evidence: vLLM speculative——高 QPS 下 draft 被频繁拒、speculation 反而偷算力,此时该关 [docs.vllm.ai speculative_decoding],同构于"升级率太高就别拆";Aider 编辑错误升级模型/换格式 [aider.chat/troubleshooting/edit-errors]。
最常见的默认值,也是本技能要挑战的反射。它把少量高价值决策调用和大量机械执行调用按同一个价位收费——要么为执行层overpay(全用最强),要么为决策层欠配(全用便宜,难题翻车)。先按 §2.1 分层,再选模型。
2–3 次调用、总成本可忽略的工作流,拆成 S+E 两层引入的协调/翻译开销(supervisor 翻译 worker 输出要多花 token [langgraph Case 2];architect 多一次往返)经常超过节省。拆分有固定成本,只在调用次数多、执行层占大头时才回本。
凭"便宜模型应该够用"的直觉降级,不在自己任务上量 (质量 delta, 成本 delta)。别人 benchmark 的绝对数不可移植——Aider 的 85% 是 Polyglot 上特定模型对的结果,不是你的任务的保证。必须按 §3 Step 3 自测。
逼弱 editor 产 token 高效但字节敏感的 diff,或把代码包进 JSON tool-call。弱模型在这些格式上合规率塌。便宜执行者要配它擅长的格式(whole / 简单 schema),见 OP-4。
便宜执行者必然有长尾失败。没有失败检测 + 升级回退,坏输出直接进产物。拆分必须连阀门一起设计(OP-3),否则省的钱用 debug 坏结果赔回去。
"要么全强要么全便宜"是把连续的拆分点退化成二元开关。正确做法是按升级率/质量 delta 往返微调哪些步在哪层(§3 Step 5)。
把为大模型调好的拆分/提示原样套到小模型上。DSPy 明示"为 GPT-4 优化的复杂管线在 Llama-3-8B 上通常崩" [dspy Case B]。换执行层模型家族 = 重测拆分,不是免费迁移。
本技能适用当:工作流多次调用 LM;调用间认知负荷不均;成本/延迟有约束;你能在自己任务上量质量 delta。
本技能不适用当:单次调用、无内部步骤(无角色可拆);微型工作流(拆分开销 > 节省,见反模式 2);质量是唯一目标且预算无限(直接全程最强模型);本质是"选哪个推理引擎"而非"如何分层用模型"(那是 llm-engine-selection 技能)。
同一个形状,四个名字。 每一行都是"强模型决策 + 廉价模型执行 + 失败时回退/纠正"。
| 框架 | 这个模式叫什么 | Tier-S(强/决策) | Tier-E(廉价/执行) | 升级/纠正阀门 | 公开证据 |
|---|---|---|---|---|---|
| Aider | architect + editor | architect 模型(o1-preview)出自然语言方案 | editor 模型(Sonnet/o1-mini)落成 diff | 编辑错误→升级模型/换格式重试 | Polyglot 79.7%→82.7%→85% [aider.chat/2024/09/26] |
| DSPy | optimizer-LM vs task-LM | 这里是镜像:被服务的 task-LM(gpt-4o)才贵;脚手架可降级 | optimizer-LM(gpt-4o-mini)跑提示搜索/提案 | 优化平台→重编译/换 LM 家族 | mini 优化器 + 4o 任务,质量持平成本大降 [dspy #1596] |
| LangGraph | supervisor + worker | supervisor 路由/综合/决定下一步 | worker sub-agent 执行具体子任务 | supervisor 重新路由;swarm 互相 handoff | supervisor 比 swarm 多花 token(翻译开销)[langgraph Case 2] |
| vLLM | speculative draft + target | target 模型验证、给真分布 | draft 模型(小/EAGLE/n-gram)先草拟 token | 验证拒绝→用 target 分布纠正;高 QPS 关闭 | 最高 ~2.5× 解码加速 [developers.redhat.com 2025 eagle3] |
DSPy 行里便宜的是 optimizer(脚手架/meta 层),贵的是 task(最终产物)。这不矛盾——判据始终是 §2 那一条:质量直接进最终产物的调用用强模型,只是脚手架的调用降级。在 Aider/LangGraph/vLLM 里执行层是产物的一部分但机械,所以降级;在 DSPy 里 optimizer 不进产物,所以降级。同一个原则,不同的"哪类是脚手架"。
先问每次 LM 调用:它的输出是最终产物,还是脚手架/草稿/可被验证的提议? 是产物且需判断 → Tier-S。是草稿/脚手架/可验证提议 → Tier-E + 升级阀门。
Automatically, when a task matches. Use when designing or cost-optimizing a pipeline that calls an LM many times, when deciding which steps need a strong reasoner vs a cheap executor, or when adding an escalation valve for when
Skills that do similar work, with their headline benchmark lift.
From the same source and nearby in the catalogue.