Show HN:以半价提供具有前沿质量的小型模型并进行蒸馏服务
Show HN: Distill and serve small models with frontier quality for half the cost

原始链接: https://github.com/experientiallabs/world-model-optimizer

**世界模型优化器 (WMO)** 是一个旨在将现有智能体轨迹转化为持续性能改进系统的平台。通过利用世界模型模拟、元框架优化和模型蒸馏,WMO 能够帮助用户在实现前沿级智能体质量的同时,降低超过 40% 的运营成本。 **核心功能包括:** * **智能路由:** 基于您的 OpenTelemetry (OTel) 轨迹调整并部署路由器,自动为特定任务选择最具成本效益的模型。 * **模拟与测试:** 利用内置的世界模型模拟智能体环境,实现稳健的闭环评估与优化。 * **自动化优化:** 使用命令行界面 (CLI) 优化提示词、工具、策略和运行时代码。只有通过严格评估关卡的配置才能成为“冠军”版本。 * **安全执行:** WMO 与 E2B 沙盒集成以实现隔离且可扩展的执行,并通过外部管理凭据来维护安全性。 * **开发工作流:** 该平台支持本地代码实时同步、分离式后台执行,以及用于对比基准性能的清晰报告。 WMO 简化了从原始轨迹到自主改进智能体栈的过渡过程,为本地开发和托管式生产级优化提供了必要的工具。

Experiential Labs 推出了开源工具 **world-model-optimizer (wmo)**,旨在降低 AI 智能体的运行成本,同时保持前沿水平的性能。 该平台利用您现有的智能体跟踪记录(traces),通过以下三种主要方法持续改进小型专用模型: * **蒸馏(Distillation):** 使用来自大型开源前沿模型的数据来训练更小、更高效的模型。 * **模型路由(Model Routing):** 根据任务复杂度,自动将任务分配给前沿模型或您蒸馏出的模型。 * **Token 压缩(Token Compaction):** 去除提示词中的冗余信息,以减少延迟并降低成本。 用户可以在本地运行 `wmo serve` 来创建一个兼容 OpenAI 的端点;该端点会进行请求路由,并随着新跟踪记录的收集不断提升性能。对于偏好托管基础设施的用户,Experiential Labs 提供了托管解决方案,承诺相比使用标准前沿模型至少可节省 40% 的成本。 感兴趣的用户可以在 YouTube 上观看演示,或在 [experientiallabs.ai](https://experientiallabs.ai) 加入等候名单。
相关文章

原文

wmo turns agent traces you already collect into continuous improvement. Start with a model endpoint at frontier quality with 40%+ lower cost. Keep improving it with world model simulations, meta-harness optimization, and model distillation.

World model, runtime agent, and optimizer connected in a continuous improvement loop

🌐 Platform | 📚 Docs | Discord

1. Register your providers.

pip install world-model-optimizer
wmo providers set

2. Tune a router on your OTel traces.

wmo build --file traces.jsonl --name my-endpoint

# Score every registered model on held-out tasks from your traces
wmo optimize route sweep my-endpoint --traces traces.otel.jsonl

# Turn those measurements into a routing policy
wmo optimize route fit matrix.json --kind knn \
  --out .wmo/models/my-endpoint/policy.json

3. Serve it.

wmo serve --name my-endpoint

See what it bought you against the model you were using before:

wmo optimize route report matrix.json .wmo/models/my-endpoint/policy.json \
  --baseline gpt-5.5

Distill your own small model into the pool with wmo optimize model, serve a single model with no routing via wmo optimize route pin, or build an optimized harness for your agent with wmo optimize harness.

Create an account at platform.experientiallabs.ai, then authenticate the CLI:

Copy an agent ID from the platform and run its current champion harness:

Hosted agents already run in platform-managed E2B sandboxes. To evaluate a local optimization in E2B, install the extra and provide an E2B key:

pip install "world-model-optimizer[e2b]"
export E2B_API_KEY=...
wmo optimize harness my-agent my-environment --tasks tasks.jsonl --backend e2b

Use a world model as an API

world-model-optimizer includes world models that can be used to simulate your agent environment for testing and optimization.

from wmo import Action, ActionKind
from wmo.config.store import WorldModelStore
from wmo.engine.loader import load_world_model

model_dir = WorldModelStore(".wmo").resolve("airline")
wm, _provider = load_world_model(model_dir)

session = wm.new_session(task="check out the cart")
obs = wm.step(session.id, Action(kind=ActionKind.TOOL_CALL, name="add_to_cart",
                                 arguments={"sku": "A1"}))
print(obs.content)

Or over HTTP (same code path), namespaced by model name: GET /world_models, then POST /world_models/{name}/sessions and POST /world_models/{name}/sessions/{id}/step.

After wmo login, the same wmo run command can open a hosted world model or run an agent's current champion harness in E2B. The platform manages model and sandbox credentials, so hosted runs do not need local API keys.

wmo login
wmo run <world-model-or-agent-id>
wmo run <agent-id> -u . --task "fix the failing tests"

Workspace upload is opt-in with -u: WMO live-syncs changes and preserves concurrent local edits. Long-running agents can detach, continue in the platform, and be messaged or reattached later.

wmo run <agent-id> -u . --detach
wmo run --send "Now run the full test suite"
wmo run --attach
wmo run --end

Runtime agents and optimizers in E2B sandboxes

WMO can run the real pi worker inside isolated E2B sandboxes while the world model supplies the environment. Optimization and evaluation rollouts run in parallel, and model credentials stay outside the sandbox.

wmo optimize harness my-agent my-environment --tasks tasks.jsonl --backend e2b
wmo eval tasks.jsonl --mode closed-loop --harness my-agent --harness-backend e2b

The optimizer can change prompts, tools, policies, skills, and runtime code. Every candidate is measured against the same simulated tasks, and only changes that pass the evaluation gates become the new versioned champion harness.

Managed with uv; linting/formatting with ruff; type checking with ty. Conventions live in AGENTS.md.

uv sync --extra dev      # env + dev tools
uv run ruff check .      # lint
uv run ruff format .     # format
uv run ty check          # type check
uv run pytest -q         # tests

wmo uses anonymous usage telemetry to track the volume of usage. Telemetry is strictly metadata. It never includes prompts, traces, actions, observations, file paths, model names, provider credentials, or raw user content.

Telemetry is enabled by default. To opt out for a project:

uv run wmo config telemetry disable

This writes .wmo/settings.toml. You can re-enable it with uv run wmo config telemetry enable, check the current setting with uv run wmo config telemetry status, or disable it for a process with DO_NOT_TRACK=1 or WMO_TELEMETRY=0.

联系我们 contact @ memedata.com