fix: support LoRA archive URL outputs#29
Merged
Conversation
470fbc7 to
3cbf517
Compare
7ea6682 to
8b1cf89
Compare
1 task
kaiitunnz
requested changes
May 10, 2026
Collaborator
kaiitunnz
left a comment
There was a problem hiding this comment.
Looks good overall with two minor considerations.
dd99e64 to
5e6fa08
Compare
kaiitunnz
requested changes
May 11, 2026
Collaborator
kaiitunnz
left a comment
There was a problem hiding this comment.
Additional refactoring concerns.
| from ._base import AsyncResource, SyncResource | ||
|
|
||
|
|
||
| class _ResultEnvelope(BaseModel): |
Collaborator
There was a problem hiding this comment.
This should be moved to sdk/src/flowmesh/models/results.py.
Also, you can rename it to ResultPayload to match the server's model.
| ctx = result["_artifacts"] | ||
| ctx["base_dir"] = (output_dir / task_id).resolve().as_posix() | ||
| ctx.pop("base_url", None) | ||
| json_path.write_text(json.dumps(result, indent=2)) |
Collaborator
There was a problem hiding this comment.
Here you need to write the entire payload, not just the result.
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
- Result envelope is the canonical on-disk format. ResultPayload moves
to src/shared so both worker and server can use it. The runner and
every executor write through write_executor_result, which stamps the
_artifacts context and persists via ResultPayload.model_dump_json.
- Dispatcher's _load_stage_result round-trips through model_validate.
- User boundary unwraps: GET /results/{id} returns the flat result
(HTTP 500 on JSON or schema validation failure); SDK materialize
unwraps the bundled envelope into the on-disk results.json and
rewrites _artifacts.base_dir to the local extracted dir.
- AdapterConfig field validators take typing.Any inputs (matches the
Pydantic field_validator examples).
Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
- Rename ResultPayload to ResultEnvelope across shared, server, SDK, and tests. - SDK: move the envelope model to sdk/src/flowmesh/models/results.py; resources/results.py imports it. - SDK _finalize_materialize persists the full envelope (not just .result) so the on-disk results.json round-trips through ResultEnvelope.model_validate_json. Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
cf17a28 to
5929269
Compare
kaiitunnz
requested changes
May 11, 2026
Collaborator
kaiitunnz
left a comment
There was a problem hiding this comment.
Minor refactoring comments. Also, please add a new entry for ResultEnvelope in tests/sdk/test_schema_compat.py.
The wrap-then-write semantics are clearer than "write the envelope" (which sounds like the caller already has one). Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
Export ResultEnvelope from flowmesh.models and add the SDK<->shared pair to the schema-compat parametrization so field drift trips a test. Signed-off-by: Zhengyuan Su <su.zhengyuan@u.nus.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The first PR in RFC #28. This PR removes dead template fields, supports LoRA adapter archive references in downstream stages, and cleans up checked-in workflows, so they exercise canonical artifact refs without hardcoded local callback URLs.
Changes
src/shared/tasks/components/model.py— support typedmodel.adapters[]fields, includingurl,apply,id,archive_format,headers, andtask_id.src/worker/executors/vllm_lora_executor.py— read typed adapter config directly, supporturl, and use canonicaltask_id.src/server/dispatcher/base.py— normalize uploaded result payloads before rendering downstream stage references.templates/lora_then_inference.yaml— use an HTTP artifacturlreference for the emittedfinal_lora_archive.templates/sft_llama_two_stage.yamlandtemplates/lora_sft_llama_two_stage.yaml— use server-provided HTTP callback URLs and multipart-safe headers.templates/lora_sft_llama_two_stage.yaml— resume fromfinal_lora_archive, which is the archive emitted by LoRA SFT.templates/api_two_stage.yamlandtemplates/data_retrieval_then_inference.yaml— remove immediate regression blockers from example workflows.templates/agent_paper_collector.yaml— document the required agent LLM/search keys for the paper collector example.Side Notes
lumid-data-sdkto the latestlumid.dataSHA inpyproject.toml,uv.lock, and worker requirements.Design
Executors continue to emit artifact refs such as
{"path": "final_lora.tar.gz"}. The dispatcher resolves those refs using the canonical executor result, including uploaded HTTP result payloads that are stored in the server wrapper shape. Local artifact consumers usepath; HTTP artifact consumers useurl, which exercises the executor download-and-unpack path.LoRA adapter options are now first-class schema fields under
model.adapters[]instead of a free-formkwargswrapper, so unsupported adapter options fail validation, and the executor can use typed values directly.Test Plan
Test Result
E2E validated YAMLs:
templates/sft_llama_two_stage.yaml,templates/lora_sft_llama_two_stage.yaml,templates/conditional_echo_test.yaml,templates/diffusion_to_vlm.yaml,templates/echo_three_node_graph.yaml,templates/vlm_llava.yaml, andtemplates/lora_then_inference.yaml.Pre-submission Checklist
pre-commit run --all-filesand fixed any issues.uv run pytest tests/passes locally.uv sync --all-extras --frozen).[BREAKING]and described migration steps above.