Archived
radiance 1.7.0
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves every shipped container - Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime - /v1/messages works with Claude Code as it ships (gearwave00001) - a long agent conversation keeps its cached history when the client rewrites its last turn (manueloverride) - a stream's first event goes out with the first token, so llama-benchy measures prefill right - opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42) - four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b) - NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA adapters (baKon) - many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool arguments and the CPU's vision and audio encoders - plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
This commit is contained in:
1 parent
b068190326
commit
1e968f6e1d
739 files changed
+128447
-84632
No files matched your search
+22
-29
@@ -1,21 +1,15 @@
|
||||
/* core/server/json_partial.h -- what may be sent, and what may be called a tool call.
|
||||
/* core/server/json_partial.h -- scanning JSON text that is still arriving.
|
||||
*
|
||||
* Two questions about text that is still arriving, and they are different questions:
|
||||
* json_complete Is this a tool call? A call is reported as `finish_reason:
|
||||
* "tool_calls"` only if its arguments parse whole; a malformed call is
|
||||
* returned as ordinary content, so a tool is never called with truncated
|
||||
* arguments.
|
||||
* json_stable_prefix How much may be streamed now? A fragment is JSON-encoded into the SSE
|
||||
* payload, so it must end on a UTF-8 boundary; a split code point corrupts
|
||||
* this delta and the next.
|
||||
* json_quote_append Writes a string literal exactly as nlohmann does, for delta chunks.
|
||||
*
|
||||
* 1. "Is this a tool call?" -- answered by `json_complete`. Nothing is ever reported to a
|
||||
* client as `finish_reason: "tool_calls"` unless the arguments parse whole. A malformed call
|
||||
* is returned as ordinary content, because a client that gets a truncated arguments object
|
||||
* and is told it is a tool call will call the tool with the wrong arguments.
|
||||
*
|
||||
* 2. "How much of it can I put on the wire right now?" -- answered by `json_stable_prefix`.
|
||||
* A streamed fragment is itself JSON-encoded into the SSE payload, so it must end on a UTF-8
|
||||
* boundary: cutting a multi-byte code point in half turns one delta into mojibake and the
|
||||
* next into a decode error.
|
||||
*
|
||||
* And one way to write it: `json_quote_append`, a string literal exactly as nlohmann writes one,
|
||||
* for the chunks that carry a delta.
|
||||
*
|
||||
* This is a scanner, not a parser: it allocates nothing and builds no DOM.
|
||||
* A scanner, not a parser: it allocates nothing and builds no DOM.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -29,25 +23,24 @@ namespace server {
|
||||
/* Does `s` parse as exactly one complete JSON value, with only whitespace after it? */
|
||||
bool json_complete(std::string_view s);
|
||||
|
||||
/* Largest n <= s.size() such that s[0,n) ends on a UTF-8 code point boundary. Bytes that are not
|
||||
* valid UTF-8 at all are left alone -- this backs out of a truncation, it does not validate. */
|
||||
/* Largest n <= s.size() such that s[0,n) ends on a UTF-8 code point boundary. Invalid UTF-8 is
|
||||
* left alone: this backs out of a truncation, it does not validate. */
|
||||
size_t utf8_trunc(std::string_view s);
|
||||
|
||||
/* Largest prefix of `s` that is safe to emit as one streaming fragment: a UTF-8 boundary, and not
|
||||
* in the middle of a "\uXXXX" escape or on a lone trailing backslash. The escape rule buys
|
||||
* nothing for a client that only concatenates, and costs four bytes of latency; it is here
|
||||
* because a client that pretty-prints each delta is a client that would otherwise print a broken
|
||||
* escape, and the class of bug that produces is unbisectable from the server side. */
|
||||
/* Largest prefix of `s` that is safe to emit as one streaming fragment: on a UTF-8 boundary, not
|
||||
* inside a "\uXXXX" escape and not on a lone trailing backslash. The escape rule costs up to four
|
||||
* bytes of latency; it keeps a client that renders each delta separately from seeing a broken
|
||||
* escape. */
|
||||
size_t json_stable_prefix(std::string_view s);
|
||||
|
||||
/* Append `s` to `out` as a JSON string literal, quotes included, byte for byte as nlohmann's
|
||||
* dump() writes one: `\b \t \n \f \r \" \\` as two characters, every other control character
|
||||
* as `\u00xx` in lowercase hex, and everything else -- DEL and non-ASCII included -- as itself.
|
||||
* Returns false, with `out` as it was, when `s` is not well-formed UTF-8 (overlong forms,
|
||||
* surrogates and code points past U+10FFFF included), which nlohmann refuses rather than writes.
|
||||
* dump() writes one: `\b \t \n \f \r \" \\` as two characters, other control characters as
|
||||
* `\u00xx` in lowercase hex, everything else (DEL and non-ASCII included) as itself. Returns
|
||||
* false with `out` unchanged when `s` is not well-formed UTF-8 (including overlong forms,
|
||||
* surrogates and code points past U+10FFFF), which nlohmann refuses.
|
||||
*
|
||||
* A streamed chunk is written with this around a fixed frame instead of through a DOM: building
|
||||
* and dumping a tree per token cost more than every other part of the token's host work. */
|
||||
* Streamed chunks use this around a fixed frame: building and dumping a DOM per token cost more
|
||||
* than the rest of the token's host work. */
|
||||
bool json_quote_append(std::string& out, std::string_view s);
|
||||
|
||||
} /* namespace server */
|
||||
|
||||
Reference in new issue
Block a user