Skip to content

Commit c442fb2

Browse files
committed
perf(server): Switch spell/translate proxy to gpt-5-nano
Halves input cost ($0.10→$0.05/M) vs gpt-4o-mini and improves quality. Drop temperature=0.2 (gpt-5 only accepts default).
1 parent 1f7d946 commit c442fb2

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

server/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
PORT=3000
22
OPENAI_API_KEY=sk-...
3+
OPENAI_MODEL=gpt-5-nano
34
ALLOWED_ORIGINS=http://localhost:3000,https://antistatique.harvestapp.com,https://*.harvestapp.com,moz-extension://*,chrome-extension://*
45
ESTI_SECRET=pat-... # Re-use your Airtable PAT here (or leave empty in dev)

server/routes/spelling.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const router = Router();
66

77
const openaiKey = process.env.OPENAI_API_KEY;
88
const openai = openaiKey ? new OpenAI({ apiKey: openaiKey }) : null;
9-
const MODEL = process.env.OPENAI_MODEL || 'gpt-4o-mini';
9+
const MODEL = process.env.OPENAI_MODEL || 'gpt-5-nano';
1010

1111
// Very naive local fallback to allow basic testing without OpenAI
1212
function localSpellcheck(text) {
@@ -92,7 +92,6 @@ router.post('/', async (req, res) => {
9292
{ role: 'system', content: system },
9393
{ role: 'user', content: user },
9494
],
95-
temperature: 0.2,
9695
response_format: { type: 'json_object' }
9796
});
9897
} catch (apiErr) {

server/routes/translate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const router = Router();
66

77
const openaiKey = process.env.OPENAI_API_KEY;
88
const openai = openaiKey ? new OpenAI({ apiKey: openaiKey }) : null;
9-
const MODEL = process.env.OPENAI_MODEL || 'gpt-4o-mini';
9+
const MODEL = process.env.OPENAI_MODEL || 'gpt-5-nano';
1010

1111
router.post('/', async (req, res) => {
1212
try {
@@ -59,7 +59,6 @@ router.post('/', async (req, res) => {
5959
{ role: 'system', content: system },
6060
{ role: 'user', content: user },
6161
],
62-
temperature: 0.2,
6362
response_format: { type: 'json_object' }
6463
});
6564
} catch (apiErr) {

0 commit comments

Comments
 (0)