goose icon indicating copy to clipboard operation
goose copied to clipboard

Add Provider/Model Options to Run Command

Open haydenth opened this issue 7 months ago • 3 comments

Hello - It would be really useful if Goose had the ability to:

  • Specify the model / provider on the command line in the run schema
  • Ignore ENV vars when set explicitly like this

Here's an example from the docs of how to use run:

goose run  -t "Initialize project" 

I would like to run like this (for instance)

goose run -t "Initialize project" \
  --provider openai \
  --model gpt-4.1

This would be really useful in certain cases where I have saved recipes/instruction files that have different provider/model requirements. For instance, the task that generates a commit message can run with gemini-2.5-flash just fine but there are other recipes/saved instructions which need more firepower.

  • [x] I have verified this does not duplicate an existing feature request

haydenth avatar May 05 '25 01:05 haydenth

ran into similar case would really like to have a way to select models!

mike123789-dev avatar May 05 '25 14:05 mike123789-dev

I've created a similar ticket focused on recipe's. https://github.com/block/goose/issues/2506

ianreay avatar May 11 '25 15:05 ianreay

I'm gonna take a stab at this because this would be super useful for me

haydenth avatar Jun 10 '25 00:06 haydenth

OK submitted a PR for this. One note that it should implement the following priority logic for selecting LLM

  • CLI arguments (--provider, --model) - HIGHEST PRIORITY
  • Session settings
  • Environment variables (GOOSE_PROVIDER, GOOSE_MODEL) - LOWEST PRIORITY

@angiejones if there is someone I should assign the PR to, let me know! thank you so much

haydenth avatar Jul 08 '25 11:07 haydenth

Thank you so much for reviewing the PR so quickly!!

haydenth avatar Jul 11 '25 16:07 haydenth