Skip to content

feat(providers): derive imageToText from the OCR registry + chutes dots.ocr seed - #10291

Closed
diegosouzapw wants to merge 9 commits into
feat/ocr-multi-providerfrom
feat/imagetotext-derivation
Closed

diegosouzapw wants to merge 9 commits into
feat/ocr-multi-providerfrom
feat/imagetotext-derivation

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

PR-D (final) of the OCR/image-to-text migration series (plan: _tasks/superpowers/plans/2026-08-13-ocr-image-to-text-migration.md; heuristic pattern from aisbf, implemented in this repo's registry-derived style).

⚠️ STACKED on #10283 (feat/ocr-multi-provider) — this PR targets that branch because the derivation test covers the azure-document-intelligence provider it introduces. After #10283 merges, retarget to release/v3.8.50 (gh pr edit --base release/v3.8.50 + verify with --json baseRefName). The diff shown here is only the 2 commits of this PR.

  • imageToText derived from the OCR registry (open-sse/config/mediaServiceKinds.ts): any provider registered in OCR_PROVIDERS now resolves the imageToText serviceKind automatically — mistral and azure-document-intelligence appear in /dashboard/media-providers/imageToText with no manual catalog edit, and future OCR providers surface on registration (no drift). Complements feat(providers): declare imageToText serviceKind on major vision providers #10275, which declares the kind on the 7 major vision LLM providers.
  • Chutes seed: serviceKinds: ["llm", "imageToText"] on the chutes gateway entry (hosts rednote-hilab/dots.ocr — cheap OCR-specialized model, 131k ctx; arrives via model discovery since chutes is passthroughModels: true, so no static registry entry). "llm" declared alongside for the same ProviderCard reason as feat(providers): declare imageToText serviceKind on major vision providers #10275.

Validation (TDD)

  • imagetotext-derivation 3/3: mistral + azure derive with declared: undefined; groq with undefined does NOT (isolates derivation from feat(providers): declare imageToText serviceKind on major vision providers #10275's declarations); chutes resolves both imageToText and llm.
  • Siblings green: provider-service-kind-filter-4240, minimax-media-servicekinds (16 total).
  • check:provider-consistency OK (259 registry entries, 339 canonical providers) · typecheck:core 0 · eslint/prettier clean.
  • serviceKindIndex.ts memoization verified safe: derivation is a pure function of providerId over the constant OCR_PROVIDERS map.

⚠️ base-red inherited: #9985 (ESLint errors from #10240/#9448 — unrelated to this diff)

backryun and others added 6 commits August 13, 2026 17:50
#10373)

The `instanceof Response` guard from #10256 broke two ways:

1. `instanceof` is nominal against `globalThis.Response`, but proxyFetch dispatches
   through the npm undici package's fetch, whose Response is a different class — so
   valid upstream responses were rejected as contract violations. Replaced with
   `isResponseLike()` (instanceof fast path + structural brand/member probe); genuinely
   malformed shapes still throw.
2. The thrown error had no `.status`, so it fell through to chatCore's BAD_GATEWAY
   default — an internal defect was treated as a flaky provider, cooling the connection
   down and retrying forever. It now carries status 500 + `executor_contract_violation`,
   registered as request-scoped and terminal (no cooldown, no breaker, no retry).

batch_api.test.ts went from exit 124 (infinite hang, pinning Unit shard 4/4 in every
open PR) to exit 0, 22/22 passing.

Closes #10360
`CustomModelEntry` never declared `outputTokenLimit`, but the DB persists it
(src/lib/db/models.ts) and the catalog reads it (src/app/api/v1/models/catalog.ts),
producing TS2551 under the open-sse typecheck gate.

Verified locally against release/v3.8.50 @ 90458a6: TS2551 count in
models/catalog.ts goes 2 -> 0, and model-token-limit-catalog.test.ts passes 5/5
with the added max_output_tokens projection assertion.
…overlay contract (#10383)

#10248 changed the contract: a custom row for an id that already exists is the
operator-owned overlay for that model (catalog.ts:1330) — its explicitly stored fields
win over discovered metadata and the merged entry is flagged `custom`. Before #10248 the
duplicate was skipped, so the test asserted `custom === false` and started failing.

The stale expectation is corrected (not weakened) and an identity assertion is added:
the overlay must keep the catalog id rather than becoming a detached entry.

models-catalog-route.test.ts: 44 pass, 0 fail (was 43 pass / 1 fail).
diegosouzapw pushed a commit that referenced this pull request Aug 14, 2026
…iceKinds

The two serviceKinds declarations (openrouter here, chutes in #10291) add
exactly two data lines to the provider catalog. Frozen 1250 -> 1252 with the
justification recorded in the baseline key.
diegosouzapw pushed a commit that referenced this pull request Aug 14, 2026
…iceKinds

The two serviceKinds declarations (openrouter here, chutes in #10291) add
exactly two data lines to the provider catalog. Frozen 1250 -> 1252 with the
justification recorded in the baseline key.
…iceKinds

Same rebaseline as #10275 (frozen 1250 -> 1252): this branch adds the chutes
serviceKinds declaration, the second of the two data lines.
@diegosouzapw
diegosouzapw force-pushed the feat/imagetotext-derivation branch from 3a4736d to ef4ef47 Compare August 14, 2026 14:04
diegosouzapw added a commit that referenced this pull request Aug 14, 2026
…iders (#10275)

* feat(providers): declare imageToText serviceKind on major vision providers

The /dashboard/media-providers/imageToText category was empty by design:
imageToText has no backing registry and no catalog entry declared it.
Declare serviceKinds: ["llm", "imageToText"] on the 7 major vision-capable
providers (openai, anthropic, gemini, openrouter, mistral, xai, groq) so the
category lists them and the Modality Bridge ?tab=vision shortcut becomes
reachable from their provider detail pages.

"llm" is declared alongside because ProviderCard treats an EMPTY serviceKinds
as "regular LLM provider" — declaring only imageToText would silently hide the
inline Test button and the playground default (guarded by the new test).

Refs #9760

* chore(quality): rebaseline gateways.ts file-size for imageToText serviceKinds

The two serviceKinds declarations (openrouter here, chutes in #10291) add
exactly two data lines to the provider catalog. Frozen 1250 -> 1252 with the
justification recorded in the baseline key.

* chore(quality): rebaseline deadExports for the OCR/image-to-text series

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
@diegosouzapw
diegosouzapw deleted the branch feat/ocr-multi-provider August 14, 2026 16:47
@diegosouzapw

Copy link
Copy Markdown
Owner Author

Superseded by #10400 — same commits, retargeted at release/v3.8.50. This one was auto-closed by GitHub when #10283 merged with --delete-branch, which removed the base branch it was stacked on.

yawar-aquil added a commit to yawar-aquil/OmniRoute that referenced this pull request Aug 19, 2026
…tion

Adding the tabitoken gateway grows src/shared/constants/providers/apikey/
gateways.ts from 1255 to 1270 lines, over its frozen size. The growth is
+15 data lines and is entirely this PR's own diff, reproducible on this
branch alone -- so it is not the combination drift that WS5.5 reserves for
the release captain, and it must not be pushed onto the release branch.

Extraction is not an available alternative here: the file is pure data
("Pure data; merged by apikey/index.ts via spread" in its own header) and
is already decomposed into 6 family files under apikey/, so one new gateway
entry is irreducible growth.

Rebaselined with a justification note, following the precedent already in
this file for the same path: _rebaseline_2026_08_14_imagetotext_servicekinds
(diegosouzapw#10275/diegosouzapw#10291, gateways.ts 1250->1255, data lines only) and
_rebaseline_2026_08_11_v3850_merge_storm_provider_registry.
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…iders (diegosouzapw#10275)

* feat(providers): declare imageToText serviceKind on major vision providers

The /dashboard/media-providers/imageToText category was empty by design:
imageToText has no backing registry and no catalog entry declared it.
Declare serviceKinds: ["llm", "imageToText"] on the 7 major vision-capable
providers (openai, anthropic, gemini, openrouter, mistral, xai, groq) so the
category lists them and the Modality Bridge ?tab=vision shortcut becomes
reachable from their provider detail pages.

"llm" is declared alongside because ProviderCard treats an EMPTY serviceKinds
as "regular LLM provider" — declaring only imageToText would silently hide the
inline Test button and the playground default (guarded by the new test).

Refs diegosouzapw#9760

* chore(quality): rebaseline gateways.ts file-size for imageToText serviceKinds

The two serviceKinds declarations (openrouter here, chutes in diegosouzapw#10291) add
exactly two data lines to the provider catalog. Frozen 1250 -> 1252 with the
justification recorded in the baseline key.

* chore(quality): rebaseline deadExports for the OCR/image-to-text series

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…iders (diegosouzapw#10275)

* feat(providers): declare imageToText serviceKind on major vision providers

The /dashboard/media-providers/imageToText category was empty by design:
imageToText has no backing registry and no catalog entry declared it.
Declare serviceKinds: ["llm", "imageToText"] on the 7 major vision-capable
providers (openai, anthropic, gemini, openrouter, mistral, xai, groq) so the
category lists them and the Modality Bridge ?tab=vision shortcut becomes
reachable from their provider detail pages.

"llm" is declared alongside because ProviderCard treats an EMPTY serviceKinds
as "regular LLM provider" — declaring only imageToText would silently hide the
inline Test button and the playground default (guarded by the new test).

Refs diegosouzapw#9760

* chore(quality): rebaseline gateways.ts file-size for imageToText serviceKinds

The two serviceKinds declarations (openrouter here, chutes in diegosouzapw#10291) add
exactly two data lines to the provider catalog. Frozen 1250 -> 1252 with the
justification recorded in the baseline key.

* chore(quality): rebaseline deadExports for the OCR/image-to-text series

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
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.

2 participants