Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit History
-
Run agent: cascading provider -> model -> effort -> key; current models
Verified against the providers' docs (Aug 2026): - Add a MODELS registry in lib/agent.py — Anthropic: claude-opus-5 (default), claude-fable-5, claude-sonnet-5, claude-haiku-4-5-20251001, plus 4.8/4.6 legacy; OpenAI: gpt-5.6-sol/terra/luna. Replaces the stale gpt-4o/opus-4-8 suggestions. - Effort is passed correctly per provider: Anthropic needs output_config={'effort': ...} (NOT a top-level arg), OpenAI uses reasoning_effort. Per-model level lists (Haiku 4.5 supports none; Sonnet 4.6 has no xhigh) drive the picker, and high-effort Anthropic runs get a larger max_tokens since thinking counts against it. - Page now selects provider, then model (or a custom id), then reasoning effort, then the matching API key — one model per run. - save_agent_run records provider + effort; past runs show the effort used. - run_llm.py gains --effort and updated DEFAULT_MODELS.7fccc75 -
Add 'Run agent' page: run LLMs on a submitted version and view results
- New pages/2_Run_Agent.py: pick a submission version, choose models (claude-* -> Anthropic, gpt-*/o*-* -> OpenAI, or type a custom id), paste your OWN API key (never stored), and run the trial-statistician prompt against the trial's SAP/protocol text. Answers render per question with output.R and download buttons; past runs are browsable. - New lib/agent.py: single source of truth for the prompt, SAP loading, prompt block, model calls (explicit api_key) and response parsing. - llm/run_llm.py now imports from lib/agent.py instead of duplicating the prompt (verified: --help and a full offline run still work). - storage: save_agent_run/list_agent_runs write to submissions/<DOI>__<user>/agent_runs/<stamp>__<model>.json; agent runs are excluded from list_versions and the admin list_submissions. - requirements.txt: add anthropic + openai for the Space.9ceb217