Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Conversation

@doringeman
Copy link
Contributor

From docker/model-runner#100 (comment).
Return structured response for untagged and deleted models.

docker/model-runner#100 and docker/model-cli#122 will require small changes once this PR is merged.

Without the required changes in the model-cli, this is the response I see:

$ MODEL_RUNNER_HOST=http://localhost:8080 docker model tag ai/smollm2 dorin/smollm2
Model "ai/smollm2" tagged successfully with "index.docker.io/dorin/smollm2:latest"

$ MODEL_RUNNER_HOST=http://localhost:8080 docker model inspect ai/smollm2
{
   "id": "sha256:354bf30d0aa3af413d2aa5ae4f23c66d78980072d1e07a5b0d776e9606a2f0b9",
   "tags": [
       "ai/smollm2",
       "index.docker.io/dorin/smollm2:latest"
   ],
   "created": 1742816981,
   "config": {
       "format": "gguf",
       "quantization": "IQ2_XXS/Q4_K_M",
       "parameters": "361.82 M",
       "architecture": "llama",
       "size": "256.35 MiB"
   }
}

$ MODEL_RUNNER_HOST=http://localhost:8080 docker model rm dorin/smollm2
[{"Untagged":"index.docker.io/dorin/smollm2:latest"}]
Model dorin/smollm2 removed successfully

$ MODEL_RUNNER_HOST=http://localhost:8080 docker model tag ai/smollm2 dorin/smollm2
Model "ai/smollm2" tagged successfully with "index.docker.io/dorin/smollm2:latest"

$ MODEL_RUNNER_HOST=http://localhost:8080 docker model rm -f 354bf30d0aa3af413d2aa5ae4f23c66d78980072d1e07a5b0d776e9606a2f0b9
[{"Untagged":"ai/smollm2"},{"Untagged":"index.docker.io/dorin/smollm2:latest"},{"Deleted":"sha256:354bf30d0aa3af413d2aa5ae4f23c66d78980072d1e07a5b0d776e9606a2f0b9"}]
Model sha256:354bf30d0aa3af413d2aa5ae4f23c66d78980072d1e07a5b0d776e9606a2f0b9 removed successfully

@doringeman doringeman requested a review from a team July 8, 2025 16:33
tagRef, err := name.NewTag(tag)
if err != nil {
return Index{}
return name.Tag{}, Index{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't realized in case of error we didn't return the error. Would not be better to return the error instead of empty tag/index?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, makes sense. In this PR or a separate one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do it in a follow up PR I just finished what I was working on so I can tackle it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #109. 🙌

@doringeman doringeman merged commit 67a3bf2 into docker:main Jul 10, 2025
1 check passed
doringeman added a commit to docker/model-runner that referenced this pull request Sep 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants