• Adeniji Adekunle James's avatar
    feat: add xAI (Grok) as AI provider (#1209) · f8ec10ec
    Adeniji Adekunle James 提交于
    # Add xAI (Grok) Provider Support
    
    ## Overview
    This PR adds support for xAI's Grok models as an AI provider, focusing
    on coding-optimized models.
    
    ## Changes Made
    
    ### Provider Configuration (`language_model_helpers.ts`)
    - Added xAI to `MODEL_OPTIONS` with 3 coding-focused models:
      - `grok-code-fast-1`: Fast, economical coding model (256k context)
      - `grok-4`: Most capable flagship model (256k context)
      - `grok-3`: Powerful coding model (131k context)
    
    <img width="805" height="592" alt="image"
    src="https://github.com/user-attachments/assets/a99b9495-e90e-40f3-a772-be9807b24501"
    />
    
    
    <img width="805" height="653" alt="image"
    src="https://github.com/user-attachments/assets/aad7b333-ee74-457a-b5b7-5d20bd54d7e0"
    />
    
    ## Dependencies
    - Requires `@ai-sdk/xai` package (already imported)
    - Uses existing provider pattern and infrastructure
    
    
    ## Why xAI for Coding?
    xAI's Grok models have shown impressive results in coding benchmarks:
    - Trained on high-quality programming datasets reflecting real-world
    tasks
    - Excels at agentic coding workflows with fast reasoning capabilities
    - Strong performance across multiple programming languages (TypeScript,
    Python, Java, Rust, C++, Go)
    - Achieved 70.8% on SWE-Bench-Verified using internal evaluation
    - Optimized for rapid iteration in development environments
        
    <!-- This is an auto-generated description by cubic. -->
    ---
    
    ## Summary by cubic
    Adds xAI (Grok) as a provider so users can pick Grok coding models in
    the app. Integrates provider config, client wiring, and schema updates.
    
    - **New Features**
    - Added xAI provider with env var mapping (XAI_API_KEY) and provider
    metadata.
    - Exposed models: grok-code-fast-1 (256k), grok-4 (256k), grok-3 (131k).
      - Hooked up get_model_client to use @ai-sdk/xai (createXai).
      - Included "xai" in validation schemas and model options.
    
    - **Migration**
      - Set XAI_API_KEY to enable xAI.
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarWill Chen <willchen90@gmail.com>
    f8ec10ec
名称
最后提交
最后更新
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing/fake-llm-server 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...