tzachar / cmp-ai

MIT License
196 stars 36 forks source link

Increasing max_tokens for Codestral does not work #31

Closed choucavalier closed 2 months ago

choucavalier commented 2 months ago

I have the following setup

local cmp_ai = require("cmp_ai.config")
cmp_ai:setup({
    max_lines = 500,
    provider = "Codestral",
    provider_options = {
        model = "codestral-latest",
        n = 3,
        max_tokens = 3000,
        temperature = 0.3,
    },
    notify = true,
    notify_callback = function(msg)
        vim.notify(msg)
    end,
    run_on_every_keystroke = true,
})

where I'm trying to increase the number of tokens for Codestral.

It does not result in a bigger number of tokens being in the completion, which remains limited to the default 100.

What am I doing wrong?

tzachar commented 2 months ago

use the max_lines option (which you specified to be 500).

choucavalier commented 2 months ago

Hello. Thanks for your answer. I tried the max_lines approach. It's actually the first thing that I've tried. It did not work, as I was still receiving 100 tokens max.

tzachar commented 1 month ago

I thought you meant the tokens sent to codestral. Other than that, what you did should be working. The max_tokens option is sent to codestral on each request. I suggest you try to look at the actual curl line generated, and see if something is wrong there.