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++

Image requests honor sampling (temperature, top_p, top_k, penalties, seed) like text (#75)

Niko122112ef2865628c
diff --git a/serve/server.py b/serve/server.py
index f2655815c..7054d7999 100644
--- a/serve/server.py
+++ b/serve/server.py
@@ -307,8 +307,9 @@ class StrataEngine:
the HTTP layer turns it into an SSE comment, which keeps clients' watchdogs calm and notices a client that
has gone. A consumer that stops early (or `cancel`) makes the engine STOP, so it does not run to max_new."""
self.progress = None
- head = f"GENI {int(max_new)}{self.projection_key(sampling or {})} {embeddings}" if embeddings else \
- f"GEN {int(max_new)}{self.sampling_keys(sampling or {}) if not embeddings else ''}"
+ # an image request takes the same sampling keys as text (#75: it used to decode greedily whatever was asked)
+ head = f"GENI {int(max_new)}{self.sampling_keys(sampling or {})} {embeddings}" if embeddings else \
+ f"GEN {int(max_new)}{self.sampling_keys(sampling or {})}"
try:
self.proc.stdin.write(f"{head} {','.join(str(int(t)) for t in ids)}\n")
self.proc.stdin.flush()
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index 859049e2f..5d9f171cc 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -3512,7 +3512,8 @@ int main(int argc, char** argv) {
// tuning keys (setup's calibration measures settings without restarting the engine): the PCIe share of
// the missed experts and the draft-probability floor, for this request only
double req_pcie_frac = o.pcie_frac, req_spec_min_p = o.spec_min_p;
- if (endp != nullptr) { // GENI takes only cvec=; its file path is the first token without an =
+ if (endp != nullptr) { // GENI takes the same keys (#75: image requests were always greedy); its
+ // embedding file path is the first token without an =
for (;;) {
while (*endp == ' ') ++endp;
const char* start = endp;
@@ -3524,7 +3525,6 @@ int main(int argc, char** argv) {
const std::string key = tok.substr(0, eq);
const float fv = std::strtof(tok.c_str() + eq + 1, nullptr);
if (key == "cvec") req_cvec = std::atoi(tok.c_str() + eq + 1);
- else if (geni) {} // image requests decode greedily
else if (key == "temperature") req_temperature = fv;
else if (key == "top_p") req_top_p = fv;
else if (key == "top_k") req_top_k = std::atoi(tok.c_str() + eq + 1);