Skip to content

feat(voyage): add voyage-code-4 embedding model - #19

Open
fzowl wants to merge 2 commits into
litellm_internal_stagingfrom
feat/voyage-code-4
Open

feat(voyage): add voyage-code-4 embedding model#19
fzowl wants to merge 2 commits into
litellm_internal_stagingfrom
feat/voyage-code-4

Conversation

@fzowl

@fzowl fzowl commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What

Adds the voyage/voyage-code-4 embedding model to the model cost map in both model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json.

The model is not officially released yet, so its entry mirrors the existing voyage-code-3 details:

field value
litellm_provider voyage
mode embedding
max_input_tokens / max_tokens 32000
input_cost_per_token 1.8e-07 ($0.18 / 1M tokens)
output_cost_per_token 0.0

These values should be updated once the model's final specs and pricing are published.

Why

Lets users reference voyage/voyage-code-4 for embeddings and get correct cost tracking / model info once it becomes available, without waiting for a separate release.

Tests

Adds tests/test_litellm/llms/voyage/test_voyage_code_4.py:

  • verifies the entry exists in the local model cost map with the expected fields
  • verifies litellm.get_model_info("voyage/voyage-code-4") resolves it

Both pass locally (2 passed).

@fzowl

fzowl commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

VERDICT:APPROVED

Reviewed the diff, conventions, breaking-change risk, tests, docs, and commit hygiene.

Correctness — New voyage/voyage-code-4 entry mirrors the existing voyage-code-3 fields exactly (provider voyage, mode embedding, 32k max_input_tokens/max_tokens, 1.8e-07 input cost, 0.0 output cost). Added to both model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json — the two are kept in sync, as required. Alphabetical placement is correct (after voyage-code-3, before voyage-context-3).

Fit with conventions — Adding a model = a cost-map entry plus a test; matches how models are registered here. No code paths touched, so no separate docs needed (the cost map is self-documenting).

Breaking-change risk — None. Pure additive JSON entry. If the model isn't live yet, calls fail at Voyage's API, not in litellm; nothing existing changes.

Teststests/test_litellm/llms/voyage/test_voyage_code_4.py verifies (1) the backup map has the entry with expected fields and (2) get_model_info resolves it via LITELLM_LOCAL_MODEL_COST_MAP. Both pass locally (2 passed).

Commit hygiene — Clean. No Co-Authored-By, no "Generated with", no claude/anthropic traces, no .claude/ files. Single well-scoped feat(voyage): commit authored by fzowl.

Note (non-blocking) — Pricing/specs are guessed from voyage-code-3 since the model isn't officially released. The PR description discloses this and flags that values should be updated once final specs publish. Fine as-is; just confirm a follow-up when Voyage publishes real numbers.

@fzowl

fzowl commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

VERDICT:APPROVED

Clean, low-risk addition. Reviewed correctness, convention fit, breaking-change risk, tests, docs, and commit hygiene.

Correctness

  • voyage/voyage-code-4 entry mirrors voyage-code-3 field-for-field (embedding mode, 32k max_input_tokens/max_tokens, 1.8e-07 input cost, 0.0 output cost). Consistent with existing voyage embedding entries.
  • Both model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json updated identically — the two stay in sync (required, since the backup is the shipped copy). Both parse as valid JSON.
  • Alphabetical placement correct (after voyage-code-3, before voyage-context-3).

Convention fit

  • Standard model-cost-map addition, no code paths touched.
  • New test under tests/test_litellm/llms/voyage/ follows the repo's per-provider test layout; __init__.py added.

Breaking-change risk: none. Pure additive entry + new tests.

Tests: tests/test_litellm/llms/voyage/test_voyage_code_4.py — verifies presence/fields in the backup map and get_model_info("voyage/voyage-code-4") resolution. Ran locally: 2 passed.

Docs: PR body clearly states the model is not officially released and values mirror voyage-code-3 pending final specs. Honest and self-documenting.

Commit hygiene: single commit, conventional-commit message, authored by fzowl. No Co-Authored-By, no 'Generated with', no .claude/ files.

Non-blocking note: values are speculative (unreleased model). Fine to merge given the explicit caveat in the description, but re-verify max_input_tokens and pricing against official Voyage specs once published.

@fzowl

fzowl commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

VERDICT:APPROVED

Summary

Registers voyage/voyage-code-4 in both model cost maps, mirroring the existing voyage-code-3 entry (32k context, embedding mode, $0.18/1M input tokens). Small, self-contained, low risk.

Correctness

  • New entry is byte-identical in structure to voyage-code-3 — all required fields present (litellm_provider, mode, max_input_tokens, max_tokens, input_cost_per_token, output_cost_per_token).
  • Both model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json updated identically — the two maps stay in sync (a common source of drift avoided).
  • Alphabetical placement is correct: voyage-code-3voyage-code-4voyage-context-3.
  • output_cost_per_token: 0.0 is correct for embedding mode.

Convention fit

  • Matches the established model-cost-map pattern exactly. No new code paths, no transformation logic touched — voyage embedding handling already covers the model prefix.
  • Test lives under tests/test_litellm/ per project guidance, with proper __init__.py.

Tests

  • Two focused tests: raw-map presence/field check, and get_model_info resolution via LITELLM_LOCAL_MODEL_COST_MAP. Uses monkeypatch correctly and reloads the cost map. Good coverage for the change scope.

Breaking-change risk

  • None. Purely additive — a new key in a dict. No existing entries modified.

Commit hygiene

  • Single commit, Conventional Commits format (feat(voyage): ...). Author/committer both fzowl.
  • No Co-Authored-By, no "Generated with" trailer, no .claude/ files. Clean.

Minor note (non-blocking)

  • The model is unreleased and pricing/specs are speculative (placeholder from code-3). If Voyage ships code-4 with different pricing/context, cost tracking will be silently wrong until updated. PR body already flags this and it's a trivial follow-up. Acceptable given the transparency.

Approving.

@fzowl fzowl closed this Aug 13, 2026
@fzowl fzowl reopened this Aug 14, 2026
@fzowl
fzowl changed the base branch from main to litellm_internal_staging August 14, 2026 18:53
@fzowl

fzowl commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

Housekeeping: brought the branch up to date by merging main (no rebase/reset — the branch is published), which reduced the diff back to just the 4 voyage files. Also retargeted the PR base from main to litellm_internal_staging: the repo's guard-main-branch check ("Verify PR source branch") rejects PRs to main unless they come from litellm_internal_staging or litellm_hotfix_*, and its error message directs contributions to litellm_internal_staging. All test/lint workflows still run on this base.

@fzowl

fzowl commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

VERDICT:APPROVED

Review

Correctness — Clean. voyage/voyage-code-4 entry mirrors voyage-code-3 field-for-field (32k context, embedding mode, 1.8e-07 input cost, 0.0 output). Inserted in correct alphabetical position between voyage-code-3 and voyage-context-3. Both model_prices_and_context_window.json and the litellm/..._backup.json copy are updated identically — the required pair-edit for model-map changes.

Conventions — Matches project patterns. Unit tests land in tests/test_litellm/ per CLAUDE.md, with the __init__.py package marker added. feat(voyage): commit type follows convention.

Breaking-change risk — None. Purely additive; no existing entries touched.

Tests — Two focused tests: one asserts the raw backup-map entry fields, one asserts litellm.get_model_info() resolves via LITELLM_LOCAL_MODEL_COST_MAP. Adequate for a map-only change.

Docs — N/A. Model-map entries are self-documenting; no separate doc needed.

Commit hygiene — Clean. No Co-Authored-By, no 'Generated with', no .claude/ files. Merge + CI-retrigger commits are harmless.

Minor note (non-blocking) — Pricing/specs are speculative (model not officially released), so cost tracking could be wrong until real specs publish. PR body is transparent about this and flags it for update. Acceptable given the disclosure; just remember to reconcile once official numbers land.

@fzowl

fzowl commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

VERDICT:APPROVED

Reviewed the feat/voyage-code-4 change (tracked upstream as BerriAI#36820; no PR BerriAI#36820 exists in fzowl/litellm, so posting here on the matching fork PR #19).

What it does: Registers voyage/voyage-code-4 in the model cost map, mirroring voyage-code-3 (32K context, embedding mode, $0.18/1M input tokens), plus two unit tests.

Correctness

  • Both cost-map files (model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json) are updated identically — the correct LiteLLM pattern; the two must stay in sync.
  • Both files remain valid JSON; the entry is inserted in the right alphabetical position (after voyage-code-3, before voyage-context-3) and its structure matches sibling entries exactly.
  • Values mirror voyage-code-3 verbatim, which is consistent with the commit note that the model isn't officially released with final specs yet.

Convention fit ✅ — Purely additive, follows the established provider-model-registration pattern (embedding models resolve dynamically from the cost map, so no further routing wiring is needed).

Breaking-change risk ✅ None — pure addition; no existing entries or behavior touched.

Tests ✅ — tests/test_litellm/llms/voyage/ with __init__.py and two focused tests: one asserts the backup-map entry, one verifies litellm.get_model_info resolves it under LITELLM_LOCAL_MODEL_COST_MAP. Good hygiene: uses monkeypatch.setattr to restore global model_cost and avoid test-isolation leakage.

Commit hygiene ✅ — No Co-Authored-By, no 'Generated with' trailers, no .claude/ files. Commit messages are clear and descriptive.

Minor (non-blocking) suggestions:

  1. Docs: docs/my-website/docs/providers/voyage.md lists the voyage embedding models (incl. voyage-code-3) in two tables but this PR doesn't add voyage-code-4 there — worth a one-line addition for discoverability.
  2. Placeholder specs: pricing/context are copied from voyage-code-3 because final specs aren't published. Please follow up to correct them once the model is officially released, since incorrect input_cost_per_token would produce wrong cost tracking.

Neither issue blocks merge. Clean, low-risk, well-tested addition — approved.

@fzowl
fzowl force-pushed the feat/voyage-code-4 branch from 2b1d8b5 to e93725c Compare August 15, 2026 22:12
@fzowl

fzowl commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

VERDICT:APPROVED

Reviewed the diff, the tests, and the upstream counterpart (BerriAI#36820).

Correctness — The new voyage/voyage-code-4 entry is an exact mirror of the existing voyage-code-3 values (input_cost_per_token: 1.8e-07, output_cost_per_token: 0.0, max_tokens/max_input_tokens: 32000, mode: embedding, litellm_provider: voyage). Both model_prices_and_context_window.json and the packaged ..._backup.json are added identically, so the maps stay in sync. As the PR notes, the model isn't officially released yet and these are placeholder specs to be updated on launch — reasonable, and consistent with how litellm carries pre-release Voyage entries.

Conventions & breaking-change risk — Purely additive to the cost map; no code paths change and nothing existing is modified, so there is no breaking-change risk. Tests live under tests/test_litellm/llms/voyage/ with an __init__.py, matching repo layout.

Tests — Good. test_voyage_code_4_maps_are_in_sync asserts the root/backup entries are equal and field-correct; test_voyage_code_4_get_model_info verifies resolution via litellm.get_model_info. The autouse fixture snapshots and restores litellm.model_cost, which cleanly resolves the global-state-leak concern raised by the greptile bot upstream — no isolation issue remains.

Commit hygiene — Clean. Both commits are authored by fzowl zoltan@voyageai.com, no Co-Authored-By trailers, no "Generated with" lines, and no .claude/ files in the diff.

Upstream BerriAI#36820 has no outstanding maintainer requests (the only review was the automated greptile nit, already addressed). Nothing blocking here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant