Skip to content

Add a command to list the available inference models - #206

Merged
Davidonium merged 4 commits into
mainfrom
feat/bashofmann/inference-models-list
Oct 2, 2026
Merged

Davidonium merged 4 commits into
mainfrom
feat/bashofmann/inference-models-list

Conversation

@bashofmann

@bashofmann bashofmann commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
Bildschirmfoto 2026-10-01 um 11 38 38
fix: change list packages from using authenticated calls to the global alternative
feat(inference): add inference root command with model list

@bashofmann
bashofmann marked this pull request as ready for review October 1, 2026 09:37
@bashofmann
bashofmann requested a review from a team October 1, 2026 09:37
ssyno
ssyno previously approved these changes Oct 1, 2026

@Davidonium Davidonium left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes because it got approved but I would like to understand the changes rather than requiring any changes.

Comment thread internal/state/state.go
Config *config.Config
Logger *slog.Logger
client *qcloudapi.Client
unAuthenticatedClient *qcloudapi.Client

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the reasoning for using an unauthenticated client?

I think authentication should be required in all commands used in the cli. Else commands can be automated very easily and abused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We want agents to be able to get this public information without any authentication. The APIs also are public and don't require authentication.

Comment thread .golangci.yml
- containedctx
- contextcheck
- errorlint
- goconst

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what's the reasoning for dropping goconst?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The new version created tons of new warnings to extract strings into constants that were not helpful.


func newListCommand(s *state.State) *cobra.Command {
cmd := base.ListCmd[*bookingv1.ListPackagesResponse]{
cmd := base.ListCmd[*bookingv1.ListGlobalPackagesResponse]{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this seems to be unrelated to inference models, or is model pricing included here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True, it's unrelated, but we want to also have the packages to be fetched without authentication.

Comment thread internal/cmd/inference/inference.go Outdated
Comment thread internal/cmd/output/booking.go Outdated
Comment thread internal/cmd/inference/inference.go Outdated
Comment on lines +92 to +95
// The API returns models in no particular order.
slices.SortFunc(resp.GetItems(), func(a, b *bookingv1.InferenceModel) int {
return cmp.Compare(a.GetName(), b.GetName())
})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't the api order this? I don't think this needs to be changed but I guess this ordering has to be implemented in every client.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Different clients, like the UI sort and group the models differently.

@Davidonium
Davidonium merged commit 40ffffb into main Oct 2, 2026
5 of 6 checks passed
@Davidonium
Davidonium deleted the feat/bashofmann/inference-models-list branch October 2, 2026 06:58
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.

3 participants