@tiens.nguyen/gonext-local-worker 1.0.111 → 1.0.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -142,7 +142,11 @@ const OCR_CORRECT_TIMEOUT_MS = 120_000;
142
142
  // OCR translation/correction is hardcoded to a managed Ollama service + model.
143
143
  // (The user-configurable "OCR translation model" chooser was removed.)
144
144
  const OCR_TRANSLATE_OLLAMA_URL = "https://ollama1.gomarsic.cc";
145
- const OCR_TRANSLATE_OLLAMA_MODEL = "gemma4:26b";
145
+ const OCR_TRANSLATE_OLLAMA_MODEL = "qwen3:14b";
146
+ // Ollama defaults num_ctx to 2048 and silently truncates longer inputs (keeping
147
+ // only the tail), which would drop the start of a long OCR page. Pin the context
148
+ // window to 32k so full-page/multi-paragraph OCR is corrected in one pass.
149
+ const OCR_TRANSLATE_NUM_CTX = 32768;
146
150
 
147
151
  async function workerFetch(path, init = {}) {
148
152
  const url = `${apiBase}${path.startsWith("/") ? path : `/${path}`}`;
@@ -1031,7 +1035,7 @@ async function correctOcrTextViaOllama(extractedText, base, model) {
1031
1035
  model,
1032
1036
  stream: false,
1033
1037
  think: false,
1034
- options: { temperature: 0 },
1038
+ options: { temperature: 0, num_ctx: OCR_TRANSLATE_NUM_CTX },
1035
1039
  messages: [
1036
1040
  { role: "system", content: systemPrompt },
1037
1041
  { role: "user", content: `Text:\n${extractedText}` },
@@ -1225,7 +1229,7 @@ async function runOcrJob(job) {
1225
1229
  await rm(tempDir, { recursive: true, force: true }).catch(() => {});
1226
1230
  }
1227
1231
  // Post-process: correct grammar/language via the hardcoded managed Ollama
1228
- // service (gemma4:26b). Falls back to raw OCR text on any error so the job
1232
+ // service (qwen3:14b). Falls back to raw OCR text on any error so the job
1229
1233
  // never fails here. (`payload.correctionModel` is no longer used.)
1230
1234
  extractedText = await correctOcrText(extractedText);
1231
1235
  const totalTimeSeconds = (Date.now() - start) / 1000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiens.nguyen/gonext-local-worker",
3
- "version": "1.0.111",
3
+ "version": "1.0.113",
4
4
  "description": "Polls GoNext cloud API for async local LLM jobs and runs them against Ollama/OpenAI-compatible servers on this Mac",
5
5
  "type": "module",
6
6
  "license": "MIT",