champollion 0.5.0 → 0.5.1
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/README.md +4 -4
- package/lib/config.js +1 -1
- package/lib/methods/gemini.js +1 -1
- package/lib/methods/openai.js +3 -1
- package/lib/methods/provider-pricing.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -257,7 +257,7 @@ Full reference: [the reference docs](https://champollion.dev/docs/reference/cli)
|
|
|
257
257
|
|
|
258
258
|
```bash
|
|
259
259
|
mkdir -p .githooks
|
|
260
|
-
printf '#!/bin/sh\nnpx --yes champollion@0.
|
|
260
|
+
printf '#!/bin/sh\nnpx --yes champollion@0.5 lint\n' > .githooks/pre-commit # pinned: a new release never changes what the hook runs
|
|
261
261
|
chmod +x .githooks/pre-commit
|
|
262
262
|
git config core.hooksPath .githooks # once per clone
|
|
263
263
|
```
|
|
@@ -283,7 +283,7 @@ Create `champollion.config.json` or run `champollion init`:
|
|
|
283
283
|
"version": 3,
|
|
284
284
|
"inputLocale": "en",
|
|
285
285
|
"localesDir": "./locales",
|
|
286
|
-
"model": "google/gemini-3.
|
|
286
|
+
"model": "google/gemini-3.8-flash",
|
|
287
287
|
"pairs": {
|
|
288
288
|
"en:fr": { "qualityTier": "high" },
|
|
289
289
|
"en:ja": { "method": "google-translate" }
|
|
@@ -298,7 +298,7 @@ Create `champollion.config.json` or run `champollion init`:
|
|
|
298
298
|
| `localesPattern` | `null` | Any other layout, e.g. `"src/i18n/{ns}/{lang}.json"` (replaces `localesDir`) |
|
|
299
299
|
| `contentDir` | `null` | Folder of Markdown/MDX to translate (a Hugo `content/` or any folder); each translation is written beside its source as `<name>.<locale>.md` |
|
|
300
300
|
| `format` | `"auto"` | File format: `json`, `toml`, `yaml`, or `auto` |
|
|
301
|
-
| `model` | `"google/gemini-3.
|
|
301
|
+
| `model` | `"google/gemini-3.8-flash"` | Default model (OpenRouter slug). Direct providers resolve their own default at runtime. Run `champollion models --method gemini` to discover available models. |
|
|
302
302
|
| `defaultMethod` | `"llm"` | Default translation method (overridden by `--method` flag) |
|
|
303
303
|
| `batchSize` | `80` | Keys per translation batch |
|
|
304
304
|
| `pairs` | `{}` | Per-pair method, model, and quality overrides |
|
|
@@ -348,7 +348,7 @@ Estimated translation cost:
|
|
|
348
348
|
en:it llm 2847 0 ~$0.3843
|
|
349
349
|
|
|
350
350
|
Total: ~$2.5480
|
|
351
|
-
Rates: google/gemini-3.
|
|
351
|
+
Rates: google/gemini-3.8-flash $0.30 input / $2.50 output per 1M tokens — OpenRouter's price list, read 2026-10-04 14:02 UTC; deepl $25.00 per 1M characters — the provider's published price, as checked 2026-06-08. An estimate: ~200 input + ~30 output tokens or ~25 characters per key assumed — the bill depends on the real lengths (--json has the detail).
|
|
352
352
|
|
|
353
353
|
[INFO] Translating 3 locale(s) with concurrency 50
|
|
354
354
|
[INFO] es-MX.json — 2847 missing
|
package/lib/config.js
CHANGED
|
@@ -25,7 +25,7 @@ const CONFIG_FILENAMES = ['champollion.config.json'];
|
|
|
25
25
|
|
|
26
26
|
// Canonical defaults — import these in any module that needs a fallback
|
|
27
27
|
// instead of hardcoding the string/number inline.
|
|
28
|
-
const DEFAULT_OPENROUTER_MODEL = 'google/gemini-3.
|
|
28
|
+
const DEFAULT_OPENROUTER_MODEL = 'google/gemini-3.8-flash';
|
|
29
29
|
const DEFAULT_BATCH_SIZE = 80;
|
|
30
30
|
// Max parallel API calls for JSON key-value translation. 50 is kind to
|
|
31
31
|
// free/low-tier keys on a zero-config first run (200 would hammer 429s).
|
package/lib/methods/gemini.js
CHANGED
|
@@ -18,7 +18,7 @@ import { estimateLlmCost } from './provider-pricing.js';
|
|
|
18
18
|
|
|
19
19
|
// The default model, named ONCE — it was previously written twice (here and
|
|
20
20
|
// as an inline fallback in estimateCost()) and the two could drift.
|
|
21
|
-
const DEFAULT_MODEL = 'gemini-
|
|
21
|
+
const DEFAULT_MODEL = 'gemini-3.8-flash';
|
|
22
22
|
|
|
23
23
|
class GeminiMethod extends DirectLLMMethod {
|
|
24
24
|
constructor(options = {}) {
|
package/lib/methods/openai.js
CHANGED
|
@@ -19,7 +19,9 @@ import { estimateLlmCost } from './provider-pricing.js';
|
|
|
19
19
|
|
|
20
20
|
// The default model, named ONCE — it was previously written twice (here and
|
|
21
21
|
// as an inline fallback in estimateCost()) and the two could drift.
|
|
22
|
-
|
|
22
|
+
// A dated snapshot: plain 'gpt-4o' was an alias OpenAI repoints (founder
|
|
23
|
+
// ruling 2026-10-05: exact model ids only, nothing floating).
|
|
24
|
+
const DEFAULT_MODEL = 'gpt-5.4-mini-2026-03-17';
|
|
23
25
|
|
|
24
26
|
class OpenAIMethod extends DirectLLMMethod {
|
|
25
27
|
constructor(options = {}) {
|
|
@@ -126,6 +126,9 @@ export const LLM_RATES = {
|
|
|
126
126
|
// twice the real input rate. Corrected here.
|
|
127
127
|
'gpt-4o': { provider: 'openai', input: 2.50, output: 10.00, verified: '2026-08-01' },
|
|
128
128
|
'gpt-4o-mini': { provider: 'openai', input: 0.15, output: 0.60, verified: '2026-08-01' },
|
|
129
|
+
// The openai default (a dated snapshot, which OpenRouter lists only
|
|
130
|
+
// undated as openai/gpt-5.4-mini — so this row is what prices it).
|
|
131
|
+
'gpt-5.4-mini-2026-03-17': { provider: 'openai', input: 0.75, output: 4.50, verified: '2026-10-06' },
|
|
129
132
|
|
|
130
133
|
// ── Google Gemini ──────────────────────────────────────────────────
|
|
131
134
|
// LAST VERIFIED: 2026-08-01 against the live OpenRouter draw. The values
|
|
@@ -135,6 +138,7 @@ export const LLM_RATES = {
|
|
|
135
138
|
// should have failed. Corrected here.
|
|
136
139
|
'gemini-2.5-flash': { provider: 'gemini', input: 0.30, output: 2.50, verified: '2026-08-01' },
|
|
137
140
|
'gemini-2.5-pro': { provider: 'gemini', input: 1.25, output: 10.00, verified: '2026-08-01' },
|
|
141
|
+
'gemini-3.8-flash': { provider: 'gemini', input: 0.75, output: 3.75, verified: '2026-10-06' },
|
|
138
142
|
};
|
|
139
143
|
|
|
140
144
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "champollion",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Research-grade translation engine for i18n projects. Pluggable methods, per-pair quality tiers, and deterministic script converters. Supports JSON (next-intl, i18next), TOML, and YAML (Hugo).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|