sublayer icon indicating copy to clipboard operation
sublayer copied to clipboard

Mechanism to use a different model from the same provider

Open swerner opened this issue 9 months ago • 3 comments

For example, being able to optionally choose between using gpt-3.5 for something, using gpt-4-turbo for others, or between using claude-haiku for some and claude-opus for others if you want, but for the majority of cases being able to mostly rely on the defaults.

swerner avatar Apr 23 '24 20:04 swerner

Maybe this makes sense to put in the output adapter rather than the generator? Some other thing? It seems tied to the output and/or input to figure out which model (and maybe) which provider to use?

swerner avatar Apr 23 '24 20:04 swerner

Thinking maybe there's a pattern similar to how activerecord models have overloaded find methods. If we overloaded the generate method with being able to accept some parameters we could expand the functionality of it...thinking something like:

Sublayer.configuration.ai_model = "claude-3-5-sonnet-20240620"

claude_results = MyGenerator.new(my_param: my_param).generate
gemini_flash_results = MyGenerator.new(my_param: my_param).generate(model: "gemini-1.5-flash-latest")
gpt4o_results = MyGenerator.new(my_param: my_param).generate(model: "gpt-4o")

It would probably make sense to have default mappings of models to providers like we're discussing in #85 to make this cleaner while still allowing you to override the default provider class if needed.

swerner avatar Aug 30 '24 16:08 swerner

this is very cool. all the control and a nice optional named param off of a convention that can be expanded for other kinds of provider configs in the future)

AndrewBKang avatar Aug 30 '24 16:08 AndrewBKang