feat: add 'franklin predict' prediction mode#82
Open
KillerQueen-Z wants to merge 2 commits into
Open
Conversation
A headless command + restricted capability profile for forecasting one real-world event. predictionCapabilities exposes only research tools (web search, webfetch, Exa, search X, prediction markets, market data) — no filesystem, shell, media, swaps, phone or sandbox. 'franklin predict --model M --question Q --json' runs the agent and prints a JSON envelope (finalText + tool trace + usage), so non-interactive callers (e.g. franklin.bet) can drive grounded, tool-using predictions over the CLI.
Some models never stop calling tools and hit maxTurns with an EMPTY answer (wasting the spend). Adds opt-in agent governance, used by prediction mode: - forceAnswerOnFinalTurn / maxToolCalls: withhold tools once the tool budget (or final turn) is reached, so the model must commit to a text answer. - disableModelFallback: don't silently switch to a different model on empty/ stalled output — a one-shot caller wants a clean abstain from the asked model. - disableGroundingRetry: skip the 'ungrounded claims → force tool use' retry, which fought the forced answer and polluted structured output. predict defaults: maxTurns 8, maxToolCalls 6 (tool budget is the real limiter; turns are slack for a thinking turn + the forced-answer turn). Verified: GPT-5.5 and DeepSeek V4 Pro, which previously returned empty at maxTurns, now answer cleanly. (MiniMax M3 / Kimi K2.6 still fail — upstream OpenRouter function-call defects, not addressed here.)
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.
What
Adds a headless prediction mode to Franklin:
predictionCapabilities(src/tools/index.ts) — a tight, research-only capability profile: web search, webfetch, Exa search/answer/read, search X, prediction markets, and a little market data. Excludes filesystem, shell, media generation, swaps/trade execution, phone/voice and the GPU sandbox — a forecaster looks things up, it doesn't act on the world.franklin predict(src/commands/predict.ts) — a non-interactive command.franklin predict --model M --question Q --jsonruns one model as a disciplined bettor (research the question, read live odds, commit to a pick) and prints a single JSON envelope:{ finalText, trace, turnReason, usage }.Why
Lets non-interactive callers drive grounded, tool-using predictions over the CLI. First consumer is franklin.bet (github.com/BlockRunAI/franklin-bet), which fans a question out across the model council and renders the consensus + each model's research trail.
Notes
npm i -g @blockrun/franklingives downstreamsfranklin predict.--jsonenvelope shape, not raw stdout.