Skip to content

Add a support for Grok-4 from x.ai - #281

Open
rebel1324 wants to merge 4 commits into
Robitx:mainfrom
rebel1324:feature/grok
Open

rebel1324 wants to merge 4 commits into
Robitx:mainfrom
rebel1324:feature/grok

Conversation

@rebel1324

Copy link
Copy Markdown
Contributor

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.

@rebel1324 rebel1324 changed the title Add a support for x.ai Grok-4 Add a support for Grok-4 from x.ai Aug 14, 2025
xianxu referenced this pull request in xianxu/parley.nvim Sep 26, 2026
xianxu referenced this pull request in xianxu/parley.nvim Sep 27, 2026
xianxu referenced this pull request in xianxu/parley.nvim Sep 27, 2026
The conflicts were issue files that main had received as earlier sync
snapshots (#281 before close; #290/#291 as blank templates). The branch
copies are strict supersets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xianxu referenced this pull request in xianxu/parley.nvim Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant