Skip to content

Better service#6

Open
lzx1413 wants to merge 6 commits into
mainfrom
better_serve
Open

Better service#6
lzx1413 wants to merge 6 commits into
mainfrom
better_serve

Conversation

@lzx1413

@lzx1413 lzx1413 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Introduce a local ArtifactStore and route output path validation, upload handling, task submission, wait, cancel, and output responses through shared service helpers.

Keep public API paths intact while reducing duplicated Task/OpenAI/File route behavior and preserving explicit local-only artifact semantics.

Includes focused service and OpenAI route tests for the centralized paths.## Description

Motivation

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement
  • Code refactoring
  • Documentation update
  • Other (please describe):

Changes Made

Testing

  • Unit tests pass (pytest tests/)
  • Manual testing performed
  • Benchmarks added/updated (if applicable)

Test commands:

# Add the commands used to test your changes
pytest tests/

Checklist

  • Code follows the project's coding standards (ruff)
  • Pre-commit hooks pass (pre-commit run --all-files)
  • All tests pass (pytest tests/)
  • New tests added for new functionality
  • Documentation updated (README, CLAUDE.md, docstrings)
  • Commit messages are clear and descriptive
  • PR title follows the convention: [TYPE] Brief description

Related Issues

Fixes #

Additional Notes

GPU Architecture Support

  • SM80 (Ampere, Ada Lovelace)
  • SM90 (Hopper H100)
  • SM100+ (Blackwell)

Performance Impact

lzx1413 added 6 commits July 8, 2026 16:33
Introduce a local ArtifactStore and route output path validation, upload handling, task submission, wait, cancel, and output responses through shared service helpers.

Keep public API paths intact while reducing duplicated Task/OpenAI/File route behavior and preserving explicit local-only artifact semantics.

Includes focused service and OpenAI route tests for the centralized paths.
Add artifact local root and backend boundary configuration, reject unimplemented remote backends, and enforce terminal-task cleanup by TTL, total cache size, and per-task size.

Document the local backend as the only implemented artifact backend while keeping S3-compatible storage deferred.
Broaden default rate-limit coverage, stop trusting forwarded client IP headers by default, use timezone-aware health timestamps, and inject runtime config into pipeline and stream services.

Add tests for proxy trust behavior, middleware scope, and service/runtime config propagation.
Separate request-response and stream route profiles so stream apps expose only stream/service routes, and make WebRTC/session close behavior observable across session owners.

Add route-profile and WebRTC lifecycle tests for stream-only serving boundaries.
Complete local artifact lifecycle behavior with persistent/ephemeral cleanup, failed-output preservation, local artifact ids, artifact metadata, and OpenAI response extensions.

Update English and Chinese service/stream docs to describe runtime boundaries, local-only artifact semantics, artifact-id downloads, and OpenAI artifact metadata fields.

Keep S3-compatible storage and persistent multi-instance queues explicitly deferred.
- Collect arbitrary non-file multipart form fields into TaskRequest-compatible payloads.
- Update WanVideo I2V run_with_file helpers to consume first_image_path and reject object image inputs.
- Add service tests for dynamic form fields, including resolution passthrough.
- Document recommended artifact cleanup profiles in English and Chinese service docs.

Verification:
- python -m pytest tests/unit/service/test_task_routes.py tests/integration/test_service_api.py::TestFileUpload -q
- python -m pytest tests/unit/service/test_artifact_store.py tests/unit/service/test_task_application_service.py tests/unit/service/test_service_smoke.py tests/unit/openai/test_video_routes.py tests/unit/openai/test_image_routes.py -q
- python -m ruff check telefuser/service/api/routers/tasks.py tests/unit/service/test_task_routes.py tests/integration/test_service_api.py
- python -m ruff check examples/wan_video/async_wan22_14b_image_to_video_distill_h100.py examples/wan_video/wan21_14b_image_to_video_h100.py examples/wan_video/wan21_14b_image_to_video_lora_h100.py examples/wan_video/wan22_14b_image_to_video_distill_fp8_h100.py examples/wan_video/wan22_14b_image_to_video_distill_h100.py examples/wan_video/wan22_14b_image_to_video_lora_h100.py
- python -m py_compile examples/wan_video/async_wan22_14b_image_to_video_distill_h100.py examples/wan_video/wan21_14b_image_to_video_h100.py examples/wan_video/wan21_14b_image_to_video_lora_h100.py examples/wan_video/wan22_14b_image_to_video_distill_fp8_h100.py examples/wan_video/wan22_14b_image_to_video_distill_h100.py examples/wan_video/wan22_14b_image_to_video_lora_h100.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant