ALEC-308: One LLM exchange for both features, with time for local models - #178
Open
joseanesONMS wants to merge 1 commit into
Open
joseanesONMS wants to merge 1 commit into
joseanesONMS wants to merge 1 commit into
Conversation
Root cause analysis and LLM clustering each carried their own copy of the same HTTP exchange with the model's /chat/completions endpoint, and both copies gave up after 30 seconds. A locally hosted model (LM Studio, Ollama) prefilling a large alarm set and generating a grouping needs far longer, so every clustering pass against such a model was abandoned before the answer arrived — nothing was ever recorded, and the operator saw no clustering activity at all. The exchange now lives once, in features/llm-client (LlmExchange): build the request, force a tool call, run any data-tool calls the caller offers (none yet — the MCP tools come in a later change), stop at the terminal call, and record token usage per round into the engine/api sink. Both features call it in single-shot mode, so their wire format is unchanged. Read timeouts rise to 180 s per request (60 s for the interactive validation probe), a malformed terminal call is a failure instead of an empty success, tokens the provider billed before a failure stay accounted for (usage rows, budget, gauges), the pending-analysis stale window matches the longer wait, and a base URL that a local server rejects gets a hint to append /v1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: https://opennms.atlassian.net/browse/ALEC-308
Second slice of ALEC-308, stacked on #177. Not a chat feature:
/chat/completionsis the name of the HTTP API every hosted or local LLM server exposes, and this is the one place ALEC now talks to it.features/llm-clientbundle (LlmExchange): build the request, force a tool call, run any data-tool calls the caller offers (none yet; the MCP tools come in the next slice), stop at the terminal call, record token usage per round into the ALEC-308: Chart LLM token usage on the Resource Graphs #177 sink./v1.