Claude/market data backend design pztc8i - #159
Open
SaschaHaufe wants to merge 4 commits into
Open
Conversation
A documentation review of PLAN.md surfaced 25 questions, contradictions and gaps. Fold the decisions into the body of the plan and record them in a new Decisions Log section. Notable resolutions: - Add prev_close per ticker so the watchlist daily change % has a baseline - State that the main chart, like the sparklines, accumulates client-side - Give unseeded tickers a fallback seed price instead of rejecting them - Define the tracked ticker set as watchlist plus open positions, so a de-watchlisted holding can still be valued - Treat the chat message as an intent rather than a receipt; action results render as authoritative filled/rejected chips - Settle the Docker bind mount vs named volume contradiction - Specify trade validation, watchlist rules and the actions JSON contract - Add GET /api/trades and a trade blotter panel - Truncate portfolio_snapshots on startup in simulator mode - Pick Recharts as the single charting dependency - Rename backend/db to backend/app/database, drop docker-compose.yml, add GET /api/state for a single-round-trip first paint - Document local development with a next.config.js proxy Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Cerebras is a paid inference provider. The app must cost nothing to run, so drop the provider pinning and move to a free model. The requested model id nvidia/nemotron-3-ultra-550b-a55b:free does not exist on OpenRouter; verified against the live model list and used nvidia/nemotron-3.5-lightning:free instead. Free models do not support response_format, so Structured Outputs are not available. Replace them with forced tool calling, which free models do support. Verified with a spike before writing it down: 18 calls across three runs, 8/9 schema-valid for forced tool calling. Prompt-based JSON scored 6/6 but was consistently slower head-to-head and needs fence stripping that a tool call never requires. Measured latency is 7-58 seconds, median 20-30, which invalidates the plan's reason for skipping streaming. Keep responses non-streaming but make the wait honest: an elapsed counter from the first second, a stated 20-30s expectation, new text at 60s, abandon with retry at 120s, and the input disabled throughout so impatient resends cannot burn the 20-per-minute rate limit. No fake progress bar - there is no progress to report. Also: - Add OPENROUTER_MODEL so swapping models needs no code change - Document the 20/min and 50/day free-tier rate limits - Note that env var names are case-sensitive in the Linux container - Rename the cerebras-inference skill to openrouter-inference - Fix the README docker run command, which still used a named volume Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Resolve PLAN.md open questions and switch to free OpenRouter LLM integration
Documents the market data subsystem (unified interface, price cache, GBM simulator, Massive client, SSE endpoint) as it needs to exist to satisfy the current PLAN.md, including the prev_close / daily-change-% extension that PLAN.md's decisions log added after the module was originally built but the shipped code doesn't implement yet. Section 15 lists the concrete diff against what's on disk today.
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.
No description provided.