Skip to content

feat(scan): omit model field when AURSCAN_OPENAI_MODEL is unset - #22

Merged
manticore-projects merged 1 commit into
manticore-projects:mainfrom
magillos:feat/openai-model-omittable
Jun 21, 2026
Merged

manticore-projects merged 1 commit into
manticore-projects:mainfrom
magillos:feat/openai-model-omittable

Conversation

@magillos

Copy link
Copy Markdown

The OpenAI-compatible backend sent the placeholder "default-model" whenever AURSCAN_OPENAI_MODEL was unset, which breaks routing proxies (LiteLLM, vLLM, etc.) that select the model server-side and reject unknown model names.

Build the request payload without a "model" key, and add it only when AURSCAN_OPENAI_MODEL is non-empty. Sending "model": "" is avoided since some servers reject an empty string.

  • internal/scan/llm.go: drop the default-model fallback; add model conditionally on AURSCAN_OPENAI_MODEL.
  • internal/scan/llm_test.go: new httptest-backed tests asserting the key is omitted when unset and forwarded verbatim when set.
  • README.md + CHANGELOG.md: document the new default and routing-proxy use case.

Fail-closed semantics, timeout handling, fallback-URL loop, and all other backends are unchanged.

Real-world use case. With this change I run aurscan against my own proxy fronting NVIDIA NIM (and other providers), so I can switch the underlying LLM on the fly without editing env vars or restarting aurscan.

Behavioral change to flag. This removes the hardcoded default-model placeholder that was sent when AURSCAN_OPENAI_MODEL was unset. In practice that placeholder was ignored by single-model servers (Ollama, llama.cpp, vLLM) and rejected by strict proxies — so the only users who could regress are on a server that both (a) requires the model field and (b) accepted the literal default-model. Those users should now set AURSCAN_OPENAI_MODEL explicitly. If that trade-off feels too intrusive, happy to revisit — e.g. keep the fallback only as a last resort.

The OpenAI-compatible backend sent the placeholder "default-model" whenever
AURSCAN_OPENAI_MODEL was unset, which breaks routing proxies (LiteLLM, vLLM,
etc.) that select the model server-side and reject unknown model names.

Build the request payload without a "model" key, and add it only when
AURSCAN_OPENAI_MODEL is non-empty. Sending "model": "" is avoided since
some servers reject an empty string.

- internal/scan/llm.go: drop the default-model fallback; add model
  conditionally on AURSCAN_OPENAI_MODEL.
- internal/scan/llm_test.go: new httptest-backed tests asserting the key is
  omitted when unset and forwarded verbatim when set.
- README.md + CHANGELOG.md: document the new default and routing-proxy use case.

Fail-closed semantics, timeout handling, fallback-URL loop, and all other
backends are unchanged.
@manticore-projects
manticore-projects merged commit 4ac1b6f into manticore-projects:main Jun 21, 2026
3 checks passed
@manticore-projects

Copy link
Copy Markdown
Owner

Thank you very much!

@magillos

Copy link
Copy Markdown
Author

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants