Skip to content

🔧 Solution C: Change to more deterministic model #20

Description

@GMNAPI

Context

Alternative/complementary solution if GPT-4-turbo-preview proves too non-deterministic (issue #16).

Problem

gpt-4-turbo-preview is a preview/rolling model that may:

  • Change behavior over time
  • Have inconsistent inference across regions/servers
  • Be less deterministic than stable versions

Solution

Switch to more deterministic and stable model.

Options

1. GPT-4o (Recommended)

  • Model ID: gpt-4o
  • Latest stable omni model
  • Better instruction following
  • More deterministic than turbo-preview
  • Similar performance, lower cost

2. GPT-4 Stable

  • Model ID: gpt-4-0613
  • Frozen snapshot (no updates)
  • Maximum determinism
  • Slightly slower than turbo

Implementation

Update environment variables:

# .env (local)
CHAT_MODEL=gpt-4o

# Railway (production)
# Settings → Variables → Edit CHAT_MODEL
CHAT_MODEL=gpt-4o

Verify in /debug:

curl https://llarjove-production-754a.up.railway.app/debug | jq '.config.chatModel'
# Should return: "gpt-4o"

Comparison

Model Determinism Performance Cost Notes
gpt-4-turbo-preview ⚠️ Low ⭐⭐⭐⭐⭐ $$ Rolling updates
gpt-4o ✅ High ⭐⭐⭐⭐⭐ $ Recommended
gpt-4-0613 ✅ Very High ⭐⭐⭐⭐ $$$ Frozen, expensive

Acceptance Criteria

  • Model changed in both local and Railway
  • /debug confirms new model in use
  • Tested locally with consistent responses
  • Deployed to production
  • Production behavior matches local

When to Use

Use this solution if:

  1. Solution B (few-shot) doesn't fully resolve inconsistency
  2. Diagnostic shows embeddings are identical
  3. Need maximum determinism for production reliability

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions