Skip to content

Comments

Add GPT-5.1-Codex-Max model support with configurable model selection#10

Draft
Copilot wants to merge 2 commits intocopilot/setup-web3ai-project-structurefrom
copilot/update-gpt-5-1-codex-max
Draft

Add GPT-5.1-Codex-Max model support with configurable model selection#10
Copilot wants to merge 2 commits intocopilot/setup-web3ai-project-structurefrom
copilot/update-gpt-5-1-codex-max

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Upgrades OpenAI integration from hardcoded gpt-3.5-turbo to configurable model selection, defaulting to gpt-5.1-codex-max for enhanced code generation and analysis capabilities.

Configuration

  • Added OPENAI_MODEL environment variable to .env.example (defaults to gpt-5.1-codex-max)
  • Supports gpt-3.5-turbo, gpt-4, gpt-4-turbo-preview, gpt-5.1-codex-max

Backend Changes

Node.js (backend/openai.js)

// Before: hardcoded model
const completion = await openai.chat.completions.create({
  model: "gpt-3.5-turbo",
  max_tokens: 150,
  // ...
});

// After: configurable with higher token limits
const DEFAULT_MODEL = process.env.OPENAI_MODEL || 'gpt-5.1-codex-max';
const completion = await openai.chat.completions.create({
  model: model || DEFAULT_MODEL,
  max_tokens: 500,
  // ...
});

Python (ai_scripts/sample_ai.py)

  • Similar pattern: environment-based model selection
  • Increased token limits: 300→500 (contract analysis), 200→400 (explanations)
  • Enhanced system prompts for code-focused tasks

Application

  • index.js displays active model in startup banner
  • Both Node.js and Python demos show model configuration

Documentation

  • Added "GPT-5.1-Codex-Max Features" section detailing capabilities and use cases
  • Model selection guide with comparison table
  • Updated all usage examples to reflect new model

Model selection is backward compatible—users can override via OPENAI_MODEL environment variable.

Original prompt

I can’t view PR #9 in lippytm/Web3AI due to an access/tool error. Please either grant Copilot Chat access to the repo or paste the relevant files/changes here, and tell me what you want updated with GPT-5.1-Codex-Max (e.g., add env vars, config, README notes, dependency). Once I can see the PR or have the file context, I’ll add the GPT-5.1-Codex-Max updates.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: lippytm <65956507+lippytm@users.noreply.github.com>
Copilot AI changed the title [WIP] Update project with GPT-5.1-Codex-Max changes Add GPT-5.1-Codex-Max model support with configurable model selection Jan 8, 2026
Copilot AI requested a review from lippytm January 8, 2026 21:07
Copy link
Owner

@lippytm lippytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do whatever needs to be done

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.

2 participants