Repository navigation
Conversation
- anthropic.rs: alias any model id starting with "claude" to the loaded default
so Claude Code requests (claude-sonnet-4-5-*, claude-opus-4-7-*, ...) don't
get rejected by validate_model_name on a single-model engine.
- disk_kv_cache save: per-process unique tmp name ({key}.{pid}-{seq}.kv.tmp)
instead of the shared {key}.kv.tmp, so two concurrent saves of the same
key no longer truncate each other's in-flight payload.
- disk_kv_cache load: bound text_len and payload_bytes against cache budget
before allocating, so a malformed/malicious file can't OOM the process.
- mistralrs/src/speculative.rs: delete. mistralrs-core stopped re-exporting
SpeculativePipeline/SpeculativeLoader (only SpeculativeConfig and MtpConfig
remain) when the API pivoted to MTP-based speculative decoding (gemma4 /
deepseek v3 MTP heads). The old draft+target TextSpeculativeBuilder no
longer compiles. Re-add a builder for the MTP path if there's demand.
These should have been in cc0e774 but a stray pathspec error in the git add invocation dropped them. - anthropic.rs: alias any model id starting with "claude" (case-insensitive) to the loaded default, so Claude Code's claude-sonnet-4-5-* / claude-opus-4-7-* ids don't get rejected by validate_model_name on a single-model engine. - disk_kv_cache save: unique per-process tmp name ({key}.{pid}-{seq}.kv.tmp) via TMP_SEQ atomic counter, instead of the shared {key}.kv.tmp -- two concurrent saves to the same key no longer truncate each other. - disk_kv_cache load: bound text_len and payload_bytes against the cache budget before allocating, so a malformed/malicious file can't OOM-kill the engine.
Code Metrics Report━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Language Files Lines Code Comments Blanks ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ C Header 5 305 210 52 43 CSS 5 1462 1288 39 135 CUDA 60 20622 16570 1656 2396 Dockerfile 1 38 21 8 9 JavaScript 19 3972 3089 488 395 Jinja2 7 694 656 5 33 JSON 27 9400 9397 0 3 Makefile 1 6 5 0 1 MDX 1 147 0 132 15 Metal Shading Lan| 34 13466 10542 1117 1807 PowerShell 1 300 227 30 43 Python 131 10161 8357 462 1342 Shell 4 948 765 106 77 Plain Text 3 3723 0 2413 1310 TOML 30 1427 1237 46 144 TypeScript 11 1607 1371 66 170 YAML 4 41 39 2 0 ───────────────────────────────────────────────────────────────────────────────── HTML 4 782 695 38 49 |- CSS 1 578 544 14 20 |- JavaScript 1 24 23 0 1 (Total) 1384 1262 52 70 ───────────────────────────────────────────────────────────────────────────────── Jupyter Notebooks 3 122 83 23 16 |- Markdown 1 60 30 22 8 |- Python 1 122 113 1 8 (Total) 304 226 46 32 ───────────────────────────────────────────────────────────────────────────────── Markdown 210 19178 0 13456 5722 |- BASH 123 1399 1090 190 119 |- Dockerfile 3 6 6 0 0 |- JSON 35 1175 1175 0 0 |- PowerShell 5 7 7 0 0 |- Python 45 1717 1459 65 193 |- Rust 64 2423 2048 56 319 |- TOML 16 318 250 4 64 |- YAML 3 18 17 1 0 (Total) 26241 6052 13772 6417 ───────────────────────────────────────────────────────────────────────────────── Rust 602 259959 229293 6654 24012 |- Markdown 400 9599 454 7977 1168 (Total) 269558 229747 14631 25180 ───────────────────────────────────────────────────────────────────────────────── Svelte 18 1831 1696 50 85 |- CSS 1 4 4 0 0 |- JavaScript 18 876 727 24 125 (Total) 2711 2427 74 210 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Total 1181 368517 293488 35197 39832 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
…ot post-parse
The earlier aliasing attempt set model_id=None for the routing call but left
openai_req.model = the claude id, so parse_request still rejected it
("Requested model 'claude-sonnet-4-5-...' is not available"). Map claude-* to
"default" inside anthropic_to_openai (before parse_request); the response still
echoes the originally requested id. Verified live: claude-sonnet-4-5-* and
claude-opus-4-7 now work both streaming and non-streaming against a single-model
engine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #5 (Anthropic SSE streaming).
Fixes
anthropic.rs: aliasclaude-*model ids to the loaded defaultdisk_kv_cache.rssave: unique per-process tmp name (race fix)disk_kv_cache.rsload: boundtext_len+payload_bytesagainst budget (OOM fix)mistralrs/src/speculative.rs(upstream removedSpeculativePipelinefrom public re-exports; MTP is the new path)Tests
mistralrs-server-core::anthropicunit tests still passcargo check -p mistralrsclean after deletingspeculative.rscargo check -p mistralrs-server --features cudaclean