gp.nvim
gp.nvim copied to clipboard
Add a support for Grok-4 from x.ai
Summary
- Adding a support for Grok-4 model by adding "xai" as a provider
Changes
- Adding "xai" provider
- Adding "Grok-4" model (provider: xai, model-id: "grok-4-latest")
Added Config
{
provider = "xai",
name = "Grok-4",
chat = false,
command = true,
-- string with model name or table with model name and parameters
model = { model = "grok-4-latest", temperature = 0 },
system_prompt = require("gp.defaults").code_system_prompt,
},
Note
- the response has been tested for some coding assignments.
- The reponse time is very slow (approx 1-2 seconds), compared to other model provider.
- the temperature parameter configuration was brought from the default curl example that x.ai provided.
- the pricing of grok-4 is input for $3/mil, output for $15/mil.
- If requested, I can add grok-3 (same pricing, but if you want to) and grok-3 mini (more cheaper) in configuration.