Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

Merge branch 'f-139-resp' into f-139-rel

Niko122146a4ef5cb2d2
diff --cc serve/server.py
index 60174b71c,21aa6e38b..179975bf9
--- a/serve/server.py
+++ b/serve/server.py
@@@ -51,11 -51,12 +51,13 @@@ ROOT = Path(__file__).resolve().parents
sys.path.insert(0, str(ROOT / "tools"))
sys.path.insert(0, str(ROOT)) # run as a script (run-<model>.bat) as well as a module
from serve.frontend import (ChatTemplate, Event, OutputParser, anthropic_to_messages, # noqa: E402
- images_of, openai_to_messages)
+ images_of, mark_think_literals, openai_to_messages, unmark_think_literals)
from serve.mcp import McpCancelled, hub_from_config # noqa: E402
+from serve import runconfig # noqa: E402
from serve.winjob import contain # noqa: E402
from serve.structured import StructuredOutputError, prepare_format, validated_json # noqa: E402
+ from serve import responses as responses_api # noqa: E402
+ from serve.responses import ResponsesError, error_body as responses_error_body # noqa: E402
IM_END = "<|im_end|>"
IMAGE_PAD = "<|image_pad|>"
@@@ -1619,7 -1438,7 +1621,8 @@@ class Service
sampling = {**defaults, **req_values}
parser = OutputParser(thinking=thinking, tools=tools, stream_tools=True)
detok, n, finish = Detokenizer(self.tok), 0, "length"
+ run_tok, run_len, repeated = None, 0, False # #606: the current run of one repeated token
+ thinking_n = 0 # tokens written while thinking (Responses' reasoning_tokens)
timings, before = None, None # this request's timings; the engine's `last` before it
raw_ids = [] # every generated id (STRATA_DEBUG: dump raw model text)
emb = getattr(self.embeddings, "path", None)
@@@ -1669,11 -1488,7 +1672,12 @@@
break
raw_ids.append(t)
seg.append(t)
+ thinking_n += parser.state == "reasoning"
+ run_len = run_len + 1 if t == run_tok else 1
+ run_tok = t
+ if self.repeat_stop_tokens and run_len >= self.repeat_stop_tokens:
+ repeated = True # #606: a degenerate output, not an answer: end it here
+ break
evs = parser.feed(detok.push(t))
self._note(n, evs)
last_print = self._progress(last_print)
@@@ -2431,9 -2231,8 +2436,11 @@@ def make_handler(svc: Service)
if path == "/settings":
self._settings()
return
+ if path == "/config":
+ self._config_post()
+ return
+ if path in ("/unload", "/load") and not self._control_body():
+ return
# JSON from Strata's own page only, as /settings: else a plain form POST from any site unloads the model
if path in ("/unload", "/load") and not self._own_page("the model can be loaded or unloaded"):
return