AbanteAI / mentat

Mentat - The AI Coding Assistant
https://mentat.ai
Apache License 2.0
2.42k stars 226 forks source link

"Provider is required when unknown models are used" but no way to set provider for gpt-4-turbo. #560

Closed CarlQLange closed 2 months ago

CarlQLange commented 3 months ago

Annoyingly because of Textual I can't even see the full traceback - I can't find where the error text is even generated in Mentat or in Spice.

My mentat_config.json:

{
        "model": "gpt-4-turbo-preview",
        "maximum_context": 128000,
        "auto_context_tokens": 8000
}

Bit frustrating. Is there some way I should set this that I'm not seeing?

CarlQLange commented 3 months ago

I got around this by monkeypatching https://github.com/AbanteAI/spice/blob/main/spice/models.py and adding a line for gpt-4-turbo

GPT_4_TURBO_PREVIEW = TextModel("gpt-4-turbo-preview", OPEN_AI, 128000)
biobootloader commented 2 months ago

Sorry about that! I've added gpt-4-turbo-preview and all the new OpenAI models from today to Spice and released a new version. Mentat isn't updated to use the new spice version yet though, I'm not sure if there are conflicts - @PCSwingle can you upgrade Mentat's spice dependency tomorrow, and also see if there's a way to get Textual to show more error details?

CarlQLange commented 2 months ago

I think ideally this info would also be configurable and passed from the .mentatconfig.json as well!

PCSwingle commented 2 months ago

Hey @CarlQLange! Just pushed a PR that fixes this and lets you set the provider via config. Thanks for catching this!

CarlQLange commented 2 months ago

Thanks a bunch!