generation-and-refinement
Use FlashRAG generators, prompt templates, OpenAI/vLLM/HF/FastChat backends, multimodal generation, refiners/compressors, and judgers as reusable components.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- generation-and-refinement
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use FlashRAG generators, prompt templates, OpenAI/vLLM/HF/FastChat backends, multimodal generation, refiners/compressors, and judgers as reusable components.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/generator-api.md4.9 KB
- 参考文档references/model-and-backend-options.md4.9 KB
- 参考文档references/refiner-and-judger.md5.0 KB
- 参考文档references/troubleshooting.md6.4 KB
- 脚本scripts/inspect_generation_config.py10.2 KB
03 SKILL.md 正文
Generation and Refinement
Use this sub-skill when a task asks you to configure, instantiate, call, or debug FlashRAG generation-side components rather than build indexes, assemble full RAG methods, or report final metrics.
Route by Task
- Text generation: Use
flashrag.utils.get_generator(config)andgenerator.generate(...); see generator-api.md. - Prompt construction: Use
flashrag.prompt.PromptTemplateto convert questions, retrieval results, messages, and previous generations into backend-ready strings or chat messages; see generator-api.md. - Backend selection: Choose
framework: hf,vllm,fschat, oropenai, then align model paths, credentials, optional packages, andgeneration_params; see model-and-backend-options.md. - Multimodal generation: Use HF-backed multimodal generators with message blocks containing text and image content; see model-and-backend-options.md.
- Refiners and compressors: Use
flashrag.utils.get_refiner(config)or a concrete refiner to compress retrieved documents or prompts; see refiner-and-judger.md. - Judgers: Use
flashrag.utils.get_judger(config)when a pipeline needs a component that decides whether or how strongly to retrieve; see refiner-and-judger.md. - Preflight checks: Run the bundled safe checker before loading large models or calling APIs:
python skills/flashrag/sub-skills/generation-and-refinement/scripts/inspect_generation_config.py path/to/config.yaml; see troubleshooting.md.
Boundaries
This sub-skill owns generator, prompt, refiner, compressor, and judger components. For retrieval model setup, index files, corpus processing, and reranking, use the retrieval/indexing sub-skill. For complete methods such as Self-RAG, FLARE, Adaptive-RAG, Trace, or end-to-end experiment scripts, use the pipelines/methods sub-skill. For evaluation metrics or WebUI behavior, use the evaluation/WebUI sub-skill.
Safety Notes
- Do not paste real OpenAI or Azure credentials into examples, reports, or generated configs; use placeholders or environment variables.
- Treat
generator_model_path,refiner_model_path, and judger model paths as user-supplied model identifiers or local paths; validate intent before downloading or loading large models. - The bundled inspector is static and does not import FlashRAG, load models, download tokenizers, or make API calls.
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).