cli-and-ui
Use smolagents command-line entry points, browser automation CLI, Gradio UI helpers, and lightweight web-server patterns. Use when a task mentions smolagent, webagent, interactive CLI mode, CLI flags, GradioUI, launch_gradio_demo, browser agent demos, or serving a smolagents chat UI.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- cli-and-ui
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use smolagents command-line entry points, browser automation CLI, Gradio UI helpers, and lightweight web-server patterns. Use when a task mentions smolagent, webagent, interactive CLI mode, CLI flags, GradioUI, launch_gradio_demo, browser agent demos, or serving a smolagents chat UI.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/cli-reference.md4.6 KB
- 参考文档references/troubleshooting.md4.1 KB
- 参考文档references/ui-workflows.md4.2 KB
- 脚本scripts/print_cli_help.py1.8 KB
03 SKILL.md 正文
CLI And UI
Use this sub-skill when the user wants to run smolagents from a terminal or expose an already-designed agent through a local UI/server.
Route First
- For agent construction,
CodeAgentvsToolCallingAgent, model objects, managed agents, and tool definitions, route to the sibling agent/model/tool sub-skills. - For sandbox executors, remote execution backends, import allow-lists, and security hardening beyond the CLI
--importsflag, route toexecution-and-safety. - For this sub-skill, focus on command syntax, UI wrapping, optional extras, browser/UI dependencies, and troubleshooting terminal or serving failures.
Core Entry Points
smolagentis the general CLI for running aCodeAgentorToolCallingAgentfrom a prompt or an interactive setup wizard.webagentis a specialized browser-automation CLI that starts a Selenium/Helium Chrome session and runs a vision-capableCodeAgentwith screenshot callbacks.GradioUIwraps aMultiStepAgentin a streaming Gradio chat interface with optional multimodal file upload.launch_gradio_demo(tool)launches a GradioInterfacefor a singleToolwhoseinputsandoutput_typeare defined; useGradioUIfor full agent chat UIs.- Server examples are adaptation patterns: run the blocking
agent.run(...)call off the async event loop and disconnect external tool clients during shutdown.
Safe Discovery
Before running model-backed tasks, use safe help checks:
python sub-skills/cli-and-ui/scripts/print_cli_help.py --command smolagent
python sub-skills/cli-and-ui/scripts/print_cli_help.py --command webagent
smolagent --help
webagent --help
If console scripts are unavailable but the package imports, try module-level help:
python -m smolagents.cli --help
python -m smolagents.vision_web_browser --help
Common Workflows
- Run a direct CLI prompt with
smolagent "your task" --model-type InferenceClientModel --model-id Qwen/Qwen3-Next-80B-A3B-Thinking --tools web_search. - Start the guided wizard with bare
smolagent; it prompts for action type, tools, model settings, optional API fields, additional imports, and final task. - Use
--action-type codefor a code-writingCodeAgent; use--action-type tool_callingfor aToolCallingAgent. - Use
webagent "browser task" --model-type LiteLLMModel --model-id gpt-4oonly when browser, model, and optional vision dependencies are installed and a Chrome/WebDriver stack is usable. - Wrap a configured agent with
GradioUI(agent, file_upload_folder="uploads", reset_agent_memory=True).launch(share=False)for a local chat UI.
References
- See CLI reference for command names, flags, defaults, and behavior.
- See UI workflows for
GradioUI, streaming, file upload, server adaptation, and monitoring notes. - See troubleshooting for missing scripts, optional extras, invalid model/tool flags, and browser failures.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).