backend-runtime
Work on Langflow FastAPI backend routes, graph execution, services, settings, auth/authz, database, migrations, storage, telemetry, and runtime errors.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- backend-runtime
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Work on Langflow FastAPI backend routes, graph execution, services, settings, auth/authz, database, migrations, storage, telemetry, and runtime errors.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-and-services.md10.3 KB
- 参考文档references/database-and-authorization.md10.4 KB
- 参考文档references/troubleshooting.md9.9 KB
- 脚本scripts/inspect_routes.py4.9 KB
03 SKILL.md 正文
Backend Runtime
Use this sub-skill for Langflow backend implementation tasks: FastAPI routes, API router wiring, flow execution internals, service dependencies, settings behavior, authorization guards, database sessions, Alembic migrations, storage boundaries, telemetry, and runtime error diagnosis.
Route elsewhere when the task is primarily:
- SDK or external client usage: use
../sdk-and-api-clients/. - Docker, cloud, or production deployment operations: use
../deployment-and-operations/. - Python component class authoring or bundles: use
../component-development/. - Local flow JSON authoring and validation without backend changes: use
../flow-authoring/.
Start Here
- Classify the affected backend surface: route/API, flow execution, service/settings, authz, database/migration, storage, or telemetry.
- Read references/api-and-services.md for router mounting, route dependency patterns,
simple_run_flow, request parsing, tweaks, service access, and focused API validation. - Read references/database-and-authorization.md before changing guarded routes, share-aware fetches, database models, sessions, or Alembic migrations.
- Use references/troubleshooting.md when a backend run, CLI/API call, auth decision, database connection, migration, file upload, or optional dependency fails.
- Inspect mounted routes with the bundled helper when route prefixes or hidden routes are unclear:
python scripts/inspect_routes.py --module langflow.api.router --router router --include-hidden
Backend Change Checklist
- Keep route handlers explicit about authentication, authorization, response status, response models, and 403-vs-404 privacy behavior.
- Use
get_*_service()helpers for managed services; avoid module-level settings reads for flags that may be supplied by--env-fileor runtime environment variables. - For flow execution endpoints, preserve JSON and multipart parsing behavior,
tweakssemantics, telemetry logging, job-service execution, memory-base fire-and-forget behavior, and streaming error propagation. - For authorization-aware fetches, widen cross-user loading only when an immediate
ensure_*_permission(...)guard follows. - For migrations, follow expand/migrate/contract safety and validate the specific migration before broad backend tests.
Useful Validation Commands
Run the narrowest safe check that covers the change:
python -m py_compile skills/langflow/sub-skills/backend-runtime/scripts/inspect_routes.py
uv run pytest src/backend/tests/unit/api/v1/test_flows.py -q
uv run pytest src/backend/tests/unit/api/v1/test_authz_share_routes.py -q
uv run pytest src/backend/tests/unit/alembic/test_migration_validator.py -q
Use uv run for repository Python commands. Avoid credentialed provider tests, live external services, GPU/transformer execution, or destructive migration fixes unless the user explicitly asks and the environment is disposable or backed up.
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).