mohdel 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mohdel",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Christophe Le Bars",
@@ -136,7 +136,7 @@
136
136
  "@opentelemetry/exporter-trace-otlp-grpc": "^0.222.0",
137
137
  "@opentelemetry/sdk-node": "^0.222.0",
138
138
  "chalk": "^6.0.1",
139
- "mohdel-thin-gate-linux-x64-gnu": "3.3.0"
139
+ "mohdel-thin-gate-linux-x64-gnu": "3.4.0"
140
140
  },
141
141
  "dependencies": {
142
142
  "@anthropic-ai/sdk": "^0.129.0",
package/src/cli/index.js CHANGED
@@ -40,7 +40,7 @@ if (command === '-h' || command === '--help') {
40
40
  const { default: providerDefs } = await import('../lib/providers.js')
41
41
  const keyRows = Object.keys(PROVIDER_INFO)
42
42
  .map(name => [providerDefs[name].apiKeyEnv, `${PROVIDER_INFO[name].label} API key`])
43
- .concat([['MOHDEL_LOCAL_API_SK', 'Bearer token for a local server, if it wants one']])
43
+ .concat([[providerDefs.local.optionalApiKeyEnv, 'Bearer token for a local server, if it wants one']])
44
44
  const keyWidth = Math.max(...keyRows.map(([k]) => k.length))
45
45
  const keys = keyRows.map(([k, d]) => ` ${k.padEnd(keyWidth + 2)}${d}`).join('\n')
46
46
  console.log(`mohdel — self-hosted LLM gateway and SDK for Node
@@ -1,3 +1,5 @@
1
+ const LOCAL_API_KEY_ENV = 'MOHDEL_LOCAL_API_SK'
2
+
1
3
  // `contextSemantics` and `outputCapStrategy` are published facts about a
2
4
  // provider, not switches: mohdel caps `outputBudget` to the model's
3
5
  // `outputTokenLimit` whatever they say. They exist so an embedder building its
@@ -82,7 +84,8 @@ const providers = {
82
84
  sdk: 'openai',
83
85
  api: 'chatCompletions',
84
86
  catalog: false,
85
- resolveConfiguration: () => ({ apiKey: process.env.MOHDEL_LOCAL_API_SK || '' }),
87
+ optionalApiKeyEnv: LOCAL_API_KEY_ENV,
88
+ resolveConfiguration: () => ({ apiKey: process.env[LOCAL_API_KEY_ENV] || '' }),
86
89
  contextSemantics: 'shared',
87
90
  outputCapStrategy: 'accept'
88
91
  },