Compare commits

...

2 Commits

Author SHA1 Message Date
a7c304ccb5 Config: Switch receipt parsing to Qwen3-VL-Thinking model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:06:18 -05:00
f622912f2e Improve: Support reasoning models in AI vision pipeline
Strip <think>...</think> blocks from reasoning model output (e.g.
Qwen3-VL-Thinking) and increase max_tokens from 4096 to 16384 to
accommodate thinking token overhead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:04:29 -05:00
2 changed files with 7 additions and 3 deletions

View File

@@ -220,6 +220,10 @@ namespace MoneyMap.Services
{
var trimmed = content?.Trim() ?? "";
// Strip <think>...</think> blocks from reasoning models (e.g. Qwen3-VL-Thinking)
trimmed = System.Text.RegularExpressions.Regex.Replace(
trimmed, @"<think>[\s\S]*?</think>", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Trim();
// Strip markdown code fences
if (trimmed.StartsWith("```json"))
{
@@ -816,7 +820,7 @@ namespace MoneyMap.Services
}
}
},
max_tokens = 4096,
max_tokens = 16384,
temperature = 0.1
};
@@ -898,7 +902,7 @@ namespace MoneyMap.Services
OpenAIToolUseHelper.BuildToolsArray(tools),
toolExecutor,
maxToolRounds,
maxTokens: 4096,
maxTokens: 16384,
_logger);
}
catch (TaskCanceledException ex) when (ex.InnerException is TimeoutException)

View File

@@ -21,6 +21,6 @@
"AllowedHosts": "*",
"AI": {
"ModelsEndpoint": "http://athena.lan:11434",
"ReceiptParsingModel": "llamacpp:Qwen3-VL-32B-Instruct-Q8_0"
"ReceiptParsingModel": "llamacpp:Qwen3-VL-32B-Thinking-Q8_0"
}
}