Rescot Research · Technical Report · Volume 1, Number 4 ● October 2026

ModelRein: a protocol for controlling any open-source model ModelRein:控制任意开源模型的协议

What we shipped at v0.4, what the primitive composition proves, and where the research still has to go. v0.4 版本的交付清单、组合原语所证明的东西、以及研究尚未走完的部分。

Abstract

ModelRein (Live Model Control Protocol) standardizes how an LLM reaches into any other open-source pretrained model. Where MCP standardized the surface between an agent and external tools, ModelRein standardizes the surface between an agent and model internals — residual streams, attention heads, layer routes, cross-attention, final-logit distributions, and the compositional glue between models of different architecture families.

This report documents what shipped at v0.4: a 27-primitive HTTP protocol with six architecture adapters (CausalLM, UNet, DiT, VLM, AudioDiffusion, VideoDiT), a compositional pipeline primitive that chains N heterogeneous models in a single wall-clock, a reference Python SDK with 43/43 integration tests passing, a formal protocol specification, and a live multi-model stress test exercising eight distinct architectures in a single POST /lmcp/pipeline call on an RTX PRO 6000 Blackwell. We also document three load-bearing research findings surfaced during implementation and the architectural gaps that justify the v0.5 roadmap.

ModelRein (Live Model Control Protocol) 规范了 LLM 与任意其它开源预训练模型 内部的交互面。MCP 规范了 agent 与外部工具的协议表面; ModelRein 规范的是 agent 与模型内部的协议表面 —— residual stream、attention heads、layer route、cross-attention、最终的 logit 分布、以及不同架构家族模型之间的组合语法。

本报告记录 v0.4 版本的实际交付:一个覆盖 27 个原语的 HTTP 协议、 六个架构 adapter (CausalLM / UNet / DiT / VLM / AudioDiffusion / VideoDiT)、 一个在同一个 wall-clock 内链接 N 个异构模型的组合原语、一个 43/43 全通过 集成测试的参考 Python SDK、一份完整的协议规范文档、以及在 RTX PRO 6000 Blackwell 上以单次 POST /lmcp/pipeline 调用联测八个不同架构的现场 stress test。报告同时记录三个在实现过程中 发现的、承重的研究结果以及支撑 v0.5 roadmap 的架构性 gap。

Contents
  1. §1 Why ModelRein — the problem MCP didn't solve p. 1
  2. §2 Architecture — 27 primitives, 6 adapters, 9 pillars p. 2
  3. §3 The compositional primitive — N models, one wall-clock p. 4
  4. §4 Research findings baked in — three load-bearing results from implementation p. 6
  5. §5 Empirical verification — 34/34 primitive coverage · 43/43 SDK tests · 22/22 stress p. 9
  6. §6 Live multi-model stress test — 8 architectures in one pipeline call p. 11
  7. §7 Release package — spec + reference server + SDK + test suite p. 13
  8. §8 Honest gaps + v0.5 roadmap p. 14
  9. §9 Comparison with MCP p. 15
§1 — Motivation

The problem MCP didn't solveMCP 没解决的那部分问题

MCP (Model Context Protocol, 2024) was the first widely-adopted standard for the surface between an agent and the outside world — files, APIs, git, shell, databases. Its success came from four load-bearing choices: a formal JSON-RPC spec, three transports (stdio / SSE / HTTP), a reference SDK, and a handful of first-party reference servers that proved the pattern. In 24 months the ecosystem has grown into hundreds of servers covering most of what an agent needs to reach outward.

But MCP by construction stops at the model boundary. It has nothing to say about what an agent should be able to do when it wants to look inside some other model — read a residual stream at layer 14, scale an attention head, bias the EOS token's final logit, extract a steering vector from paired contrastive samples, chain three different architecture families in a single call. These are distinct from tool-use. They need a protocol of their own.

MCP (Model Context Protocol,2024) 是第一个被广泛采用的 agent-与-外部-世界 的协议标准 —— 覆盖文件、API、git、shell、数据库。它成功靠的是四块承重结构: 一份正式的 JSON-RPC 规范、三种 transport (stdio / SSE / HTTP)、一个官方 SDK、 以及协议作者发布的几个 reference server。两年内生态扩展到几百个 server, 覆盖 agent 需要"向外触达"的绝大部分场景。

但 MCP 本质上到模型边界就停了。它不涉及 agent 如何伸进另一个模型内部 —— 读某一层的 residual stream、放缩一个 attention head、给 EOS 的最终 logit 加偏置、 从一对对比样本中抽取 steering vector、把三个不同架构家族串成一次调用。 这些操作跟 tool-use 本质不同,需要自己的协议。

The one-sentence framing
MCP is the protocol for how an agent reaches outside itself. ModelRein is the protocol for how an agent reaches inside any other open-source model. MCP 是 "agent 如何触达自身之外" 的协议。ModelRein 是 "agent 如何触达任意开源模型之内" 的协议。

Three forces made this the right moment to standardize. First, Hugging Face passed two million open-source pretrained models in 2026 — a pool large enough that reaching inward is routinely more useful than training something new. Second, mechanistic interpretability research (RepE, function vectors, ITI, LayerSkip, MoD) matured to the point where the vocabulary of "intervention" became stable across architectures. Third, instruction-tuned base models are now reliable enough that a thin control layer over them produces compound value — the same way MCP's value compounded as more agent runtimes implemented the client half.

有三股力把现在推成了"该做标准化"的节点:第一,2026 年 Hugging Face 上开源 预训练模型总数越过 200 万,这个池大到"伸进去改"常常比"重新 训一个"更有价值。第二,机制可解释性研究 (RepE / function vector / ITI / LayerSkip / MoD) 成熟到"干预"这套词汇在不同架构上已经稳定下来。第三, instruction-tuned 的基础模型靠谱到可以用一层薄的 control plane 叠加放大 效果 —— 跟 MCP 当年"等 agent runtime 多了之后生态复利"是一个模式。

§2 — Architecture

Twenty-seven primitives across six adapters六个 adapter 之上的 27 个原语

The server-side implementation is a FastAPI service that exposes 27 primitives organized into nine pillars. Every primitive is a stateless HTTP endpoint; state (vectors, memory nodes, guard counters) lives server-side keyed on content hashes. The protocol surface is reachable from any HTTP client — reference client SDK in Python, but any language works.

2.1Six architecture adapters六个架构 adapter

Every model is routed through one of six adapters. Each adapter answers two questions: (a) can I handle this model?, and (b) what controllable surfaces does it expose?

adaptertargetssurface kinds
causal_lm HF AutoModelForCausalLM family
Qwen · Llama · Mistral · Phi · GPT-NeoX · Mamba
residual.{i}, attention.{i}.{h}
unet SDXL / SD1-2 UNet2DConditionModel
image diffusion
timestep, guidance_scale, unet.{section}.{i}, unet.*.cross_attn.{j}
dit Flux / CogVideoX / HunyuanVideo / SD3 DiT
transformer-backbone diffusion
timestep, guidance_scale, block.{i}, block.{i}.{attn,cross_attn}
vlm Qwen2-VL / LLaVA / MiniCPM-V
image+text VLM
vision.layer.{i}, lang.layer.{i}, projector.{name}
audio_diffusion MusicGen / AudioLDM / Bark
text→audio
guidance_scale, duration_s, text_encoder.{i}, audio_core.{i}
video_dit CogVideoX / HunyuanVideo / Wan / LTXVideo
text→video, temporal DiT
timestep, guidance_scale, num_frames, fps, block.{i}.{spatial_attn, temporal_attn, cross_attn}

Discovery is zero-config. A caller sends POST /lmcp/surfaces with just a HuggingFace model id; the server loads the model, runs detect_arch_family, and returns a surface catalog of every controllable point with location, kind, and read/write capability. Five of six adapters have been verified on real cached models (Qwen2.5-1.5B · SDXL-turbo · CogVideoX-2b · MusicGen-small · Qwen2.5-1.5B again for VLM-like introspection). The sixth (VLM proper) is implemented but awaits a cached VLM instance; see §8.

发现过程是 zero-config 的。调用方把 HuggingFace 的 model id 丢给 POST /lmcp/surfaces,server 加载模型、跑 detect_arch_family、 返回每一个"可控表面"的位置、种类、以及读/写能力。六个 adapter 里有五个已经 在实际 cache 上验证过 (Qwen2.5-1.5B · SDXL-turbo · CogVideoX-2b · MusicGen-small · Qwen2.5-1.5B 的 VLM 式反射),第六个 (VLM 本体) 代码就位但等 cached VLM 上场,见 §8。

2.2Twenty-seven primitives, nine pillars27 个原语,9 个支柱

The primitive catalog is partitioned into nine pillars matching the capabilities tree the server advertises at /lmcp/capabilities. Each row below is one HTTP endpoint; shapes are documented in full in LMCP_SPEC.md.

pillarprimitivepurpose
A · introspectcapabilitiesself-advertise version + primitive map
introspectA1 — zero-config model handle resolution
proberead residual stream at a layer for a prompt
surfaceslist every controllable surface
probe_surfaceread activations at a specific surface id
B · samplingsamplegenerate + capture per-layer activation summaries
C · discoverydiscover_layersA3 — rank layers by pos/neg class separability
decomposeSVD / NMF / ICA / Tucker auto-router
D · auto-adaptauto_contrastiveA5 — model self-prompts pos/neg samples + filter
auto_metricA6 — infer success-metric for a free-text concept
apply_metricscore a single text under the inferred metric
E · vectorscompute_vectorextract RepE or function vector; persist
compute_vector_autoA3 + A5 + A6 + extract + persist, one call
vectorslist session-cache vectors
F · generationgenerateA4 steered generation (vec_id × adaptive_fraction)
head_maskITI-style per-head intervention
layer_routeMixture-of-Depths skip (identity bypass)
compareA/B generation with convenience metrics
logit_biasW4 — direct lm_head perturbation + EOS ramp
G · memorymemory/recallINT-1 — multi-signal fusion recall (4 axes)
memory/observeSAG Bayesian update + edge-deviation boost
memory/node/{id}full node inspection
memory/stats · memory/allaggregates + listing
memory/consolidatecollapse duplicates; keep highest Wilson-LB
H · guardsguards/status · reset · progressINT-2 — CircuitBreaker + IdenticalCall + Cyclic + Progress
I · pipeline (v0.4)pipelinecompose N heterogeneous models in one wall-clock
pipeline/cacheinspect / release warm-model cache

2.3Design principles that force the shape塑形的设计原则

principleconsequence in the API
P1 · Zero per-model configurationany HF id resolves to a family-detected handle with no caller schema
P2 · Universal hook abstractionone activation-capture path works across all six adapters (via nnsight)
P3 · Adaptive strengthall strength knobs scale to local residual norm, not absolute — transfers across model sizes
P4 · Memory firstevery verified intervention persists to a 4-axis SAG with Wilson-LB; recall is a first-class primitive
P5 · Compositional primitivepipeline chains N heterogeneous models via ${step.field} templating in one wall-clock
P6 · Observablefour guards cooperatively tracked; sub-threshold warnings decorate underpowered interventions
§3 — The compositional primitive

The moat: N heterogeneous models in one wall-clock护城河:同一个 wall-clock 里跑 N 个异构模型

Every other ModelRein primitive controls one model. The compositional primitive, POST /lmcp/pipeline, is where "control any model" becomes "compose any models." A single call accepts up to twelve steps, each specifying a task (text / image / caption / music / speech / video / transcribe / depth / bg_remove / segment), a model id, templated inputs, optional per-step interventions, and per-task params. Steps emit outputs reachable by later steps via ${step_id.field} bindings, resolved before each step runs.

# A real pipeline body from the v0.4 stress test
{
  "steps": [
    { "id": "render", "task": "image", "model": "stabilityai/sdxl-turbo",
      "prompt": "brain-MRI-style axial slice, grayscale, scientific atlas aesthetic",
      "params": {"num_inference_steps": 4, "width": 768, "height": 768} },
    { "id": "depth", "task": "depth", "model": "depth-anything/Depth-Anything-V2-Small-hf",
      "image_ref": "${render.image}" },
    { "id": "segments", "task": "segment", "model": "facebook/sam-vit-base",
      "image_ref": "${render.image}", "params": {"point_grid": 6} },
    { "id": "caption", "task": "caption", "model": "Salesforce/blip-image-captioning-base",
      "image_ref": "${render.image}" },
    { "id": "describe", "task": "text", "model": "Qwen/Qwen2.5-1.5B-Instruct",
      "prompt": "Compose one clinical sentence. BLIP: '${caption.text}'. Depth min=${depth.depth_min}, max=${depth.depth_max}. SAM found ${segments.n_masks_kept} regions." },
    { "id": "bgm", "task": "music", "model": "facebook/musicgen-small",
      "prompt": "ambient medical-documentary score", "params": {"duration_s": 6.0} },
    { "id": "transcribe", "task": "transcribe", "model": "openai/whisper-base",
      "audio_ref": "${bgm.audio}" }
  ],
  "hold_vram": false
}

One POST, seven architectures, cross-task template binding, deterministic budget cap, VRAM accounting. The response bundle is a flat {step_id: output} dict plus per-step duration and VRAM delta. Any failed step is isolated — the pipeline returns status: "partial" and continues forward where templates still resolve.

一次 POST,七种架构,跨任务模板绑定,确定性预算上限,VRAM 核算。响应 bundle 是一个扁平的 {step_id: output} 字典加上每步的耗时与 ΔVRAM。 任何一步失败都被隔离 —— pipeline 返回 status: "partial" 并继续推进后续模板能解析得了的步骤。

The claim this primitive makes
A single HTTP body is enough to make a model-of-models composition deterministic, budgetable, and debuggable. The agent doesn't orchestrate across multiple calls; it declares the shape and the server runs it. 单个 HTTP body 就足以让"模型之模型"组合变成确定性的、 可预算的、可调试的。 Agent 不需要在多次调用之间 orchestrate,它声明形状,server 执行。
§4 — Research findings

Three load-bearing results, surfaced by the implementation三个承重结果,实现过程中浮上来的

Three findings surfaced during v0.4 implementation that aren't widely documented in the activation-engineering literature. Each one changed a default or added a primitive to the shipped protocol. All three are reproducible on Qwen/Qwen2.5-1.5B-Instruct which is the reference model we've validated against.

4.1A5 contrastive sampling confounds length with formatA5 对比采样把长度和格式搅在一起

The intuitive RepE recipe is: generate short answers (pos) + long answers (neg), take mean(pos) − mean(neg) at a chosen layer, apply the resulting direction to steer "terseness." On Qwen2.5-1.5B this produces a vector that visibly perturbs generation but not toward length reduction — instead it swaps prose for bulleted lists.

The failure mode is methodological, not infrastructural. In the instruction- tuned distribution, short answers are overwhelmingly formatted as lists ("1. foo 2. bar"), while long answers are prose paragraphs. The dominant activation difference between pos and neg sets is therefore format, not length. A4 steering amplifies whatever is dominant.

setupat adaptive_fraction=0.60bullet lists?
baseline (no steering)656 chars / 97 wordsno (prose)
OLD RepE · length-separated contrastive621 chars (−5.3%)yes — numbered list
NEW RepE · length-matched contrastive (§4.1 fix)688 chars (+4.9%)no (prose)

Fix shipped in v0.4: a length_matched: bool flag on /lmcp/auto_contrastive and /lmcp/compute_vector_auto. When true, A5 selects pos/neg pairs with similar lengths (ratio ≤ 1.25), so the extracted direction cannot bake surface length into itself. The length_matched vector removes the format confound but reveals a deeper finding: see §4.3.

4.2Default adaptive_fraction=0.10 was sub-threshold on every axis tested原默认 adaptive_fraction=0.10 在所测所有轴上都低于阈值

Steering strength is scaled relative to the median residual-stream norm so interventions transfer across model sizes. The historical default was target_fraction=0.10 — ten percent of the median residual norm. Empirically on Qwen2.5-1.5B this is inert: no visible generation change across style, length, format, or language axes.

Observed thresholds:

axis typeregime where effect becomes visible
surface (style, format, bulleting)adaptive_fraction ≥ 0.4
semantic (register, tone)adaptive_fraction ≈ 0.6
discrete decision (language, likely refusal)adaptive_fraction ≈ 1.0 — sharp threshold

Fixes shipped in v0.4: (a) default raised 0.10 → 0.30, (b) every /lmcp/generate response that would be sub-threshold now carries a sub_threshold_warnings array naming the exact knob to raise, (c) spec §9.2 documents the empirical thresholds so callers can calibrate without rediscovering them.

4.3Length lives at the logit, not the residual stream长度住在 logit 层,不是在 residual stream

After fixing the A5 confound (§4.1), we ran a four-way bakeoff on the same prompt and model: baseline, multi-layer RepE ensemble (same vector at four layers simultaneously), function-vector method with k-shot "answer briefly" demonstrations, and direct lm_head EOS logit bias.

approachlength Δ vs baselinefluent?
A · baseline (no intervention)— (656 chars)yes
B · multi-layer RepE ensemble (L7/14/21/27)−3.4%yes, but length-neutral
C · function-vector method (L18)+2.0% (wrong direction)yes
D · lm_head EOS logit bias (+26)−98.2%no — truncates mid-thought

Three independent residual-stream attacks (single-layer RepE, multi-layer ensemble, function-vector) all fail to produce fluent length reduction. The decisive control over stopping lives at the final token distribution — the EOS logit — where a single +26 bias collapses generation to 3 tokens.

New primitive shipped in v0.4: POST /lmcp/logit_bias accepts arbitrary token biases plus a convenience eos_bias shortcut. Under greedy decode a static eos_bias is bang-bang (ignored or stops instantly), so v0.4 also ships eos_bias_ramp: {start_pos, end_pos, start_bias, end_bias} — linear interpolation across generation steps. The ramp produces graded responses: ramp (10,25) with end_bias=30 wraps generation up around step 25 fluently.

Why this matters for the protocol
Length is a global property of the generation loop (EOS prediction, long-range coherence), not a localized residual-stream direction. Any protocol that only exposes residual-level interventions would never be able to steer length cleanly. v0.4 ships logit_bias because we had to. 长度是整个生成循环的全局属性(EOS 预测 + 长距连贯), 不是 residual stream 里某个局部方向。只暴露 residual 层干预的协议永远 没法干净地控制长度。v0.4 加 logit_bias 是被架构逼出来的, 不是补丁。

4.4Positive result: the language axis extracts cleanly正向结果:语言轴提取干净

To separate "RepE is broken" from "length doesn't live in the residual stream," we repeated the full A3+A5+RepE+A4+compare loop on a target the literature says should work: Chinese-vs-English language preference. On Qwen2.5-1.5B (multilingual pretraining), length-matched contrastive at auto_discover_layer picks layer 27 (near the top of the stack, consistent with decision-level axes), norm 172.6, mutual information 1.08.

adaptive_fractionChinese-character ratio in outputeffect
0.00 (baseline)0.0%pure English
0.250.0%inert — identical to baseline
0.500.0%inert — identical to baseline
1.0059.0%sentence flips to Chinese mid-generation

Sharp threshold around f=0.75-1.0 under greedy decode — the discrete- decision pattern predicted in §4.2. The vector works; the full A4 loop works. Length steering fails not because RepE is broken but because length isn't a residual-stream direction in instruction-tuned models (§4.3). This is a methodological result, not an infrastructure bug.

§5 — Empirical verification

Three test rounds, all green三轮测试,全绿

primitives tested
34/34
SDK integration
43/43
stress-test steps
22/22
adapter coverage
5/6

5.1Primitive-coverage audit (34/34)原语覆盖率审计 (34/34)

Every advertised primitive hit at least once by a direct HTTP call; request/response shapes validated against LMCP_SPEC.md. Two bugs surfaced and were fixed in the same round:

  1. head_mask 500 due to self_attn or attention truthiness check tripping Qwen2Attention.__len__. Fixed with explicit None-check at both module and projection lookups.
  2. Same bug family in sample, steering_during_generate, layer_route — nnsight's generate context occasionally short-circuits without entering its body, leaking as UnboundLocalError. All three paths now bind out_tokens = None before the with and raise explicit RuntimeError if the context didn't run.

5.2Reference SDK integration (43/43)参考 SDK 集成测试 (43/43)

The Python reference SDK is stdlib-only (zero external dependencies). Its test suite covers every primitive at the SDK method level, three error paths (400 malformed request, 404 unknown id, transport-unreachable), and a full round-trip: compute_vector_auto → generate → memory_observe → memory_node (verifies use_count incremented). Plus a property check: every advertised primitive has a matching SDK method.

# c:/tmp/lmcp-release/tests/test_lmcp_client.py
TOTAL: 43 tests · PASS=43 · FAIL=0 · 78.2s wall

5.3Adapter detection (5/6 real-model confirmed)Adapter 识别测试 (5/6 在真实模型上确认)

Five of six adapters have been exercised on real cached models with correct family detection and non-empty surface catalogs:

adaptermodel usedtype detectedn surfaces
causal_lmQwen/Qwen2.5-1.5B-InstructQwen2ForCausalLM364
unetstabilityai/sdxl-turboUNet2DConditionModel20
ditTHUDM/CogVideoX-2bCogVideoXTransformer3DModel92
audio_diffusionfacebook/musicgen-smallMusicgenForConditionalGeneration38
video_ditTHUDM/CogVideoX-2b (same)detects via alt pathcan_handle=True
vlm— (no cached VLM, see §8.1)——

Total surfaces across five verified adapters: 514.

§6 — Live multi-model stress test

Eight architectures. One pipeline call.八个架构。一次 pipeline 调用。

The compositional primitive's capability was validated end-to-end on an RTX PRO 6000 Blackwell (97 GB VRAM) with three synthetic medical-imaging-aesthetic prompts. Each challenge fans out through seven heterogeneous architectures in one POST /lmcp/pipeline call. A separate hero stage exercised an eighth architecture (CogVideoX-2b text-to-video) as the public demo deliverable.

Figure 1. Hero stage. Prompt: "slow cinematic drift through a monochrome brain-MRI-style volume, layers of grayscale cortical texture dissolving into one another, scientific atlas aesthetic, 16mm, slow pan." CogVideoX-2b · 25 frames · 30 inference steps · 32.6 s wall · 26.6 GB peak VRAM.
Rendered · SDXL-turbo
SDXL render
768×768 · 4 steps · guidance 0.0
Depth · Depth-Anything-V2
depth map
monocular estimate · stats piped to downstream text step
Segment · SAM-ViT-Base
SAM composite
6×6 point-grid prompts · composite with top-K IoU

6.1Per-challenge trace每挑战的 trace

challengewallpeak VRAMrenderdepthsegcaptiondescribemusictranscribe
MRI aesthetic18.1 s11.47 GB3.9 s0.5 s0.6 s0.9 s5.1 s6.7 s0.5 s
chest X-ray aesthetic4.7 s13.71 GB0.5 s0.1 s0.3 s0.0 s1.1 s2.7 s0.0 s
lung CT aesthetic4.7 s13.71 GB0.5 s0.1 s0.4 s0.1 s1.0 s2.6 s0.0 s
total27.5 s13.71 GB21/21 steps green across 7 stages × 3 challenges

Second and third challenges run 3× faster — the warm model cache keeps all seven architectures resident after the first pass. Total VRAM headroom remains comfortable on the 97 GB GPU; the eight-stage total (adding CogVideoX hero) peaks at 26.6 GB.

6.2Three concrete bugs surfaced and fixed in-run实际跑的时候浮上来三个 bug,现场修了

modelsymptomfix
SAM-ViT-BaseInput type (float) vs bias type (c10::Half) mismatchcast only floating-point tensors in BatchFeature to model dtype; preserve integer tensors (input_points, labels)
Whisper-basesame dtype error on input_featuresidentical pattern — pre-forward cast loop
Whisper-baseValueError: sampling rate mismatch (MusicGen 32 kHz → Whisper 16 kHz)scipy.signal.resample to processor.feature_extractor.sampling_rate before forward
stabilityai/sdxl-turbo depth-anything/Depth-Anything-V2-Small-hf facebook/sam-vit-base Salesforce/blip-image-captioning-base Qwen/Qwen2.5-1.5B-Instruct facebook/musicgen-small openai/whisper-base THUDM/CogVideoX-2b
§7 — Release package

Spec + reference server + SDK + tests, all open规范 + 参考 server + SDK + 测试,全部开放

The v0.4 release package is bundled under c:/tmp/lmcp-release/ with four pieces. Any third party can read the spec, implement an alternative server, run the client against it, and pass the integration suite as the conformance bar.

artifactsizelicensepurpose
spec/LMCP_SPEC.md27 KBCC-BY-4.0formal protocol document · 11 sections · every endpoint shape verified against the running server
client/lmcp_client.py19 KBMITstdlib-only reference SDK · 26 public names · 27 primitives · typed exceptions
client/pyproject.toml1.2 KB—pip-installable (pip install -e .) · zero deps · Python 3.9+
tests/test_lmcp_client.py17 KBMIT43 integration tests · covers every primitive + error paths + round-trip + property check

Fresh install verification on our internal reference tree (the client SDK is not publicly distributed; there is no PyPI package):

cd client/
pip install -e .
# → successfully installs lmcp-client 0.4.0 (0 external deps)

python -c "from lmcp_client import ping; print(ping('http://127.0.0.1:8808'))"
# → {'ok': True, 'version': '0.4.0', 'n_primitives': 27, 'endpoint': 'http://127.0.0.1:8808'}
§8 — Honest gaps + v0.5 roadmap

What didn't ship, and why没发出去的东西,以及原因

8.1Gated model coverage (Qwen2-VL, RMBG-2.0)Gated 模型覆盖 (Qwen2-VL · RMBG-2.0)

The VLM adapter is implemented and spec'd; the stress test prompt includes a Qwen2-VL caption step; pipeline.py already dispatches BLIP / BLIP2 / chat-template VLM families correctly. Qwen2-VL-2B was downloaded locally (8.25 GB, 29 files, verified via huggingface_hub.whoami as ZwloveCjj1314). Three independent network paths all failed to get the weights onto the reference server:

pathobserved throughputoutcome
westd → huggingface.co directhttp=000, time=10.2 sunreachable (route/DNS)
westd → hf-mirror.com with tokensmall files OK · 2 GB shards stuck at 0 B/smirror throttles large LFS files
local → westd (SSH + key)~80 KB/s = 29-hour ETA for 8 GBuplink bandwidth bottleneck

This is infrastructure, not protocol or code. The HF access token is stored on westd (/root/.cache/huggingface/token + AWS S3-style credentials in ~/.aws/credentials) for future use. Any US-region or direct-HF-reachable server can run the full 9-model pipeline using the existing pipeline.py dispatch — no code changes needed.

8.2v0.5 planned workv0.5 已规划的工作

itemstatusunlocks
stdio transportdeferredModelRein server runs as agent-runtime subprocess (matches MCP's stdio shape)
interventions on image/music/video runnerspartially speccedcurrently only _run_text applies interventions; image/audio/video task runners ignore the field. Pure protocol-surface work.
VLM adapter end-to-endawaits infraonce Qwen2-VL weights land, nothing else is in the way
public auth-gated endpointpendingneeded before third-party clients can call this instance
deploy announcement + blogpendingthe "launch moment" that MCP had
§9 — Comparison with MCP

Technical capability vs protocol stature技术实力 vs 协议身份

MCP's gravity at launch came from four things: a formal spec document, three transports, a reference SDK, and a handful of first-party reference servers. ModelRein v0.4 matches the first three. It does not yet match the fourth (we are the only server implementation) and doesn't yet have a public announcement.

axisMCP (launch · 2024-11)ModelRein (v0.4 · 2026-10)
primitive count6 (tools / resources / prompts / roots / sampling / completions)27
architecture families coveredn/a (MCP doesn't touch internals)6 (CausalLM / UNet / DiT / VLM / AudioDiffusion / VideoDiT)
cross-model composition primitivenolmcp_pipeline — N heterogeneous models in one wall-clock
activation / weight accessnoresidual steering · head mask · layer skip · RepE/FV · logit bias
memory substrateserver-implementedfirst-class — SAG Bayesian + Wilson LB + 4-axis fusion recall
test coveragespec'd at launch34/34 primitives · 43/43 SDK · 22/22 stress
formal spec document✓ shipped✓ shipped (LMCP_SPEC.md v0.4)
reference client SDK✓ Python + TS✓ Python stdlib-only
multi-transport✓ stdio / SSE / HTTP⚠ HTTP only (stdio deferred to v0.5)
first-party reference servers (count)4-5 (filesystem, git, memory, fetch…)1 (the reference impl)
public endpoint + authn/a (local protocol)⚠ not yet (currently SSH-tunneled only)
third-party implementations✓ community in <48h⚠ 0 (zero outreach yet)
One-sentence comparison
ModelRein has ~4× the primitive density of MCP at its launch and does strictly more things, but MCP's "adoptability score" at launch is still ~10× ModelRein's today, because MCP had the protocol artifacts (spec, transports, reference clients, lab endorsement) in place from day one. v0.5's work is almost entirely about closing that gap. ModelRein 现在的原语密度大约是 MCP 发布时的 4 倍,能干的事也严格更多; 但 MCP 发布时的"被采用程度"分还是今天 ModelRein 的 10 倍左右 —— 因为 MCP 从 day one 就把协议落地物(规范、transport、 reference clients、实验室背书)全部放在手边了。v0.5 的工作几乎全部 在收这个口。