diff --git a/src/config.js b/src/config.js index 1291858..e9f3c75 100644 --- a/src/config.js +++ b/src/config.js @@ -29,6 +29,10 @@ if (process.env.FINNHUB_API_KEY) config.finnhub.apiKey = process.env.FINNH if (process.env.OPEN_ROUTER_API_KEY) config.openRouter.apiKey = process.env.OPEN_ROUTER_API_KEY; if (process.env.OPEN_ROUTER_LLM_MODEL) config.openRouter.llmModel = process.env.OPEN_ROUTER_LLM_MODEL; if (process.env.OPEN_ROUTER_EMBED_MODEL) config.openRouter.embeddingModel = process.env.OPEN_ROUTER_EMBED_MODEL; +// OPEN_ROUTER_CHEAP_MODEL was already set in the environment and nothing read it, +// so graph entity resolution ran on the reasoning model: 7,558 reasoning tokens to +// answer "reply with just the number", 113x the cost of a model that just answers. +if (process.env.OPEN_ROUTER_CHEAP_MODEL) config.openRouter.cheapModel = process.env.OPEN_ROUTER_CHEAP_MODEL; if (process.env.GDELT_BQ_PROJECT) config.gdelt.bigQueryProject = process.env.GDELT_BQ_PROJECT; if (process.env.GDELT_BQ_KEY_FILE) config.gdelt.bigQueryKeyFile = process.env.GDELT_BQ_KEY_FILE; diff --git a/workers/index.js b/workers/index.js index 769a406..a8804b2 100644 --- a/workers/index.js +++ b/workers/index.js @@ -26,6 +26,10 @@ const openRouter = { ...rawConfig.openRouter }; if (process.env.OPEN_ROUTER_API_KEY) openRouter.apiKey = process.env.OPEN_ROUTER_API_KEY; if (process.env.OPEN_ROUTER_LLM_MODEL) openRouter.llmModel = process.env.OPEN_ROUTER_LLM_MODEL; if (process.env.OPEN_ROUTER_EMBED_MODEL) openRouter.embeddingModel = process.env.OPEN_ROUTER_EMBED_MODEL; +// OPEN_ROUTER_CHEAP_MODEL was already set in the environment and nothing read it, +// so graph entity resolution ran on the reasoning model: 7,558 reasoning tokens to +// answer "reply with just the number", 113x the cost of a model that just answers. +if (process.env.OPEN_ROUTER_CHEAP_MODEL) openRouter.cheapModel = process.env.OPEN_ROUTER_CHEAP_MODEL; const config = { duriin_db: process.env.DURIIN_DB || resolvePath(rawConfig.duriin_db, path.resolve(configDir, "archive.sqlite")),