Spaces:
Sleeping
Sleeping
Commit History
-
Make X-HF-Bill-To configurable via HF_BILL_TO env (default smolagents) (#57)
Aksel Joonas ReediUnverified signature0b64e00 -
Restore expired sessions via summary-based catch-up (#52)
Aksel Joonas ReediUnverified signatureWhen the backend loses a session (typically: HF Space restarted), the chat now shows a small inline banner instead of silently erroring: Where were we? Let me skim the conversation so far and pick up right where we left off — or we can start something new. [ Catch me up ] [ Start fresh ] Flow, in one pass: * Frontend stashes the raw backend messages in localStorage on every mount-hydrate and turn_complete. When the backend 404s for the session id, the SSE transport and the mount effect both fire onSessionDead → the session is flagged `expired` in sessionStore; the sidebar marks it "needs a catch-up". * Catch me up → POST /api/session/restore-summary with the cached messages. Backend creates a fresh session, runs the existing summarizer (factored into summarize_messages() and shared with in-session compaction) with a restore-specific prompt that preserves the tool-call trail, and seeds the new session with that summary wrapped in a [SYS…962191f -
Read max context from litellm + compact at 90% (#54)
Aksel Joonas ReediUnverified signature* Read max context from litellm.get_model_info + compact at 90% The local _MAX_TOKENS_MAP had Claude Opus 4.6 pinned at 200k, triggering compaction at ~20% of its real 1M window. Swap the hand-maintained table for litellm.get_model_info()['max_input_tokens'], which LiteLLM keeps in sync upstream (Opus 4.6=1M, GPT-5=272k, Sonnet 4.5=200k, etc.). HF router-only ids (MiniMax, Kimi, GLM) aren't in litellm's catalog and fall through to the 200k default — close enough to their advertised ranges and safe if the model lies. Also shifts compaction to fire at 90% of max_context instead of >100%. The old condition waited until context had already overshot, risking the next LLM call hitting ContextWindowExceededError before the compact finished. 90% gives headroom for the summary call + one more turn. * Drop the legacy -10k buffer — the 90% ratio is the headroom now ContextManager was subtracting a fixed 10k tokens from max_context on top of the new 90% compaction threshold, so a 1M-window Opu…28b8f2b -
Fix parallel-research display: per-call stats in CLI and web UI (#49)
Aksel Joonas Reedi +1: lee101 Unverified signatureWhen multiple research sub-agents ran concurrently, the CLI collapsed them into a single flickering slot and every web-UI tool card showed the aggregate across all agents — so 3 parallel calls looked like 1. CLI (agent/utils/terminal_display.py): - Replace the global SubAgentDisplay singleton with SubAgentDisplayManager that tracks each agent by agent_id and renders one block per agent with independent (tool count · tokens · elapsed). - 4 rolling tool-call lines per agent (was 2). - When 2+ agents are live, switch to a compact one-line-per-agent layout (label + stats + most-recent tool). Detailed 4-line rolling view only when a single agent is active. Keeps the live region small enough to fit on one terminal page so cursor-up/erase doesn't drift when content would otherwise scroll into scrollback. - Clip every live-region line to terminal width (ANSI-aware) so a wrapped line can't corrupt the cursor-up math on narrow terminals. - On completion, erase the live block and f…5ab7c4e -
Merge pull request #50 from huggingface/fix/ctrl-c-and-streaming-rework
Aksel Joonas ReediUnverified signatureCLI: global Ctrl+C, progressive streaming, headless cleanup1481358 -
Merge pull request #51 from huggingface/feat/hf-auto-routing
Aksel Joonas ReediUnverified signatureRoute HF inference through /v1 auto-router + reasoning effort knobdc35197 -
Fix CLI particle logo text: ML AGENT → ML INTERN (#46)
Aksel Joonas ReediUnverified signature8b5b1bf -
Strip provider_specific_fields from research sub-agent messages
LiteLLM's response Message carries internal fields (provider_specific_fields, reasoning_content) that the HF router's strict OpenAI schema rejects when echoed back in a follow-up request. Rebuild the assistant Message with only role / content / tool_calls before appending to the research history. Reproduced on MiniMaxAI/MiniMax-M2.7 (the reported failure) and verified the fix across MiniMax, Kimi, GLM, Claude Opus, and GPT-5 in a multi-turn tool-calling loop.a2e8010 -
Route HF inference through /v1 auto-router + add reasoning_effort knob
Users paste bare HF model ids (MiniMaxAI/MiniMax-M2.7, moonshotai/Kimi-K2.6) with an optional :fastest|cheapest|preferred|<provider> suffix; the router picks a provider and handles failover. /model does a live preflight against /v1/models and prints providers, pricing, context, tool support — warn-and- allow for unknowns with fuzzy suggestions. Friendly messages replace LiteLLM's raw traceback for model/provider mismatches, and the noisy 'Give Feedback' banner is suppressed. Adds a reasoning_effort config + /effort command (default high). OpenAI and Anthropic get the top-level param natively; HF router gets it via extra_body with minimal->low normalization for models like MiniMax M2 that require reasoning. Frontend + backend model selectors updated to the bare-id format.0a9e96d -
CLI: global Ctrl+C handling, progressive streaming, headless cleanup
Ctrl+C: - Install a SIGINT handler via loop.add_signal_handler, re-armed each loop iteration since prompt_toolkit wipes it on prompt_async exit. - First press cancels the current turn (session.cancel() sets the asyncio Event the agent loop already checks between tokens and tool boundaries). - Second press within 1s exits the CLI. Hint is shown on first press. - Approval prompt Ctrl+C/EOF rejects remaining items instead of crashing the event listener (which used to deadlock the main loop). Streaming: - print_markdown is async and uses asyncio.sleep for the typewriter, so the event loop can service signal handlers between characters. The old time.sleep loop was blocking SIGINT delivery during a full response. - On Ctrl+C mid-render, stop cleanly (no dumping the remainder) and emit an ANSI reset so half-open color state doesn't bleed onto the next line. - _StreamBuffer renders block-by-block (paragraphs split on \\n\\n) as the LLM produces them, rather than buffering the wh…f08efb1
-
CLI /model: accept any inference-provider model id
Aksel Joonas ReediUnverified signature1c0de34 -
Fall back to user HF token for router when INFERENCE_TOKEN is unset (#39)
Aksel Joonas Reedi +1: Claude Opus 4.7 (1M context)Unverified signatureThe HF router code path only read INFERENCE_TOKEN, which is the shared server-side key set on the hosted Space so inference is free for users. On the CLI / self-hosted path that env var is absent, so requests went out with no bearer token and the router returned 401 — surfaced to users as "Authentication failed" even with a valid HF_TOKEN (issue #36). Resolve api_key in this order: 1. INFERENCE_TOKEN env (unchanged Space behavior — shared billing) 2. session.hf_token (user's OAuth / CLI token) 3. HF_TOKEN env (belt-and-suspenders for CLI) Applied to _resolve_hf_router_params, research_tool._resolve_llm_params, and ContextManager.compact. Fixes #36 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>182ddee
-
Rename CLI entry and Space assets from ml-agent to ml-intern
ae4a534
-
Rewrite research workflow to lead with literature mining
Research sub-agent now starts from papers, not docs. Default workflow: anchor paper → citation graph crawl → read methodology sections → extract result-attributed recipes → validate datasets → then code. Output format requires ranked recipe table linking results to the exact dataset + method + hyperparams that produced them.3bf831e
-
Suppress whoosh SyntaxWarning noise on startup
18ac8bd -
Update particle logo text to ML AGENT
b3993a3 -
Add ml-agent CLI entry point and update README
- Add [project.scripts] entry point so ml-agent can be installed globally via uv tool install and run from any directory - Extract cli() function from __main__ block for the entry point - Fix load_dotenv to also check project root .env when running from other directories - Rewrite README: installation, usage, architecture diagrams, events list to match current codebase275319a
-
Fix sandbox HF_TOKEN not available inside container
Secret was injected after the Space was already running, so the env var was never present in the container. Move secret injection to before the build/start cycle. Also bump OAuth token lifetime to 30 days.45e517a
-
Enhance terminal display with new markdown emphasis styles
Add support for various markdown emphasis styles in the terminal display, including strong, emphasis, code, code block, and headers. Update the Console configuration to ensure ANSI styles are preserved during rendering.e76b3d1
-
Refactor approval handling and enhance markdown table styles
4501765
-
Enhance user experience by clearing 'Waiting for approval' status immediately upon approval and refining markdown table styles for better readability and aesthetics.
4a5df81
-
Add SOTA research guidance to main agent system prompt
Instruct the agent to include a SOTA check when researching ML tasks, searching recent papers for best-performing methods before implementing.6b54665 -
Minimize S2 API calls: drop paper_details enrichment, add response cache, rate limit only with API key
84d6321 -
Add Semantic Scholar integration: citation graph, filtered search, snippet search, recommendations
Extends hf_papers with S2 backend: - citation_graph: references + citations with influence flags and intents - Smart search routing: date/category/citation filters via S2 bulk search - snippet_search: semantic full-text passage search across 12M+ papers - recommend: single/multi-paper recommendations with pos/neg examples - paper_details enriched with citation count, TL;DR, fields of study - Rate-limited S2 client with 2 retries on 429/5xx - Research prompt: paper analysis checklist, new tool guidance - Frontend shimmer labels for new operationsd81613f -
Use sandbox read endpoint for script resolution to avoid bash truncation
23be8d5 -
Add message edit and regenerate from any point in conversation
Backend: add truncate_to_user_message() on ContextManager, POST /api/truncate/{session_id} endpoint, and session_manager.truncate() helper to slice conversation history to before a given user message. Frontend: add editAndRegenerate callback in useAgentChat that truncates backend + frontend messages then resubmits via existing chat flow. UserMessage gains an inline edit mode with pencil icon on hover, TextField for editing, Enter/Escape to confirm/cancel.0611031 -
Remove outdated-API flagging line from research prompt
f91e520 -
Add SOTA-awareness to research sub-agent system prompt
bdd77ee -
Update system_prompt_v3.yaml
Aksel Joonas Reedia07515d -
Improve agent loop, tools, and research subagent for long-running autonomous tasks
- Add --no-stream and --max-iterations CLI flags for headless operation - Simplify context manager: remove staged pruning, track actual token usage - Add doom-loop detection and context budget to research subagent - Improve file tools: better enforcement, error messages, descriptions - Improve bash tool: longer timeouts, background execution guidance - Add training logging and HP sweep guidance to system prompt - Relax Python requirement to >=3.11 - Remove unused file_content_cache73882d9
-
Sync main.py: markdown stream buffer, shimmer timing fixes
477a013 -
Only show plan_tool output in CLI, hide all other tool outputs
e296da8 -
Use Haiku 4.5 for research sub-agent
eba82cc -
Use Haiku for research sub-agent when main model is Anthropic
fd87f8e -
Research stats tick every second via background timer
9d8d295 -
Live research stats: tool count, tokens, elapsed time in header
a96af97 -
Show full sub-agent tool call lines, no truncation
3d0a369 -
Revert "Sub-agent log: tool_name → output_preview on one line"
This reverts commit f362c920a30671ed78d07fa9ad8ad25f3b313005.a6c60ef -
Sub-agent log: tool_name → output_preview on one line
d1b62e5 -
Log 20-char output preview for sub-agent tool calls
53f2739 -
Sub-agent display: 2 lines, gray, 20 char truncation
ca36d1f -
Indent ASCII banner to match all other output
6132a19 -
Indent all agent output, remove turn separator line
ad9fcf9 -
Render streamed responses as markdown, indent agent output for alignment
f8cf893 -
Hide research sub-agent tool_call and tool_output from CLI display
50ccfe7 -
Tool output: last 10 lines for main agent, rolling 3-line display for sub-agents
01df4c7 -
Fix Ctrl+C at idle prompt: no false interrupt, no stuck state
89a00bb -
Full HF-yellow ASCII art banner for CLI
c99339e -
Fix streaming: line-buffered output instead of per-token Live re-render
babd3b5 -
Overhaul CLI visual design with rich-powered formatting
- Replace ASCII banner with compact rich Panel - Remove init noise (token loaded, MCP servers, etc.) - Replace "Turn complete" banner with subtle separator - Tool calls display as clean `▸ name args` - Rich-themed help command with syntax highlighting - Centralize all display functions in terminal_display module - Remove Colors class dependency from reliability_checks8c7924f