Skip to content

feat: add OpenAI embedding model support via Foundry embeddings proxy - #44

Merged
anandpant merged 2 commits into
mainfrom
feat/openai-embeddings
Jul 12, 2026
Merged

feat: add OpenAI embedding model support via Foundry embeddings proxy#44
anandpant merged 2 commits into
mainfrom
feat/openai-embeddings

Conversation

@anandpant

@anandpant anandpant commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds real embeddingModel()/embedding() support to the Foundry OpenAI provider, backed by @ai-sdk/openai's embedding surface pointed at Foundry's OpenAI embeddings proxy (/api/v2/llm/proxy/openai/v1/embeddings), reusing the existing auth/attribution/trace-context header assembly.
  • Adds text-embedding-3-small and text-embedding-3-large as typed convenience aliases. Unlike the language-model endpoints, the embeddings proxy takes a plain OpenAI model string in the request body, not a Foundry RID. Known aliases resolve to themselves; any other model string passes through unchanged, mirroring the spirit of raw-RID passthrough on the language-model path.
  • Anthropic and Google embeddingModel() continue to throw NoSuchModelError (Foundry only documents the OpenAI embeddings proxy).
  • Exports OpenAIEmbeddingModelId / KnownOpenAIEmbeddingModelId / OPENAI_EMBEDDING_MODEL_IDS / OPENAI_EMBEDDING_MODELS from the root entrypoint, additive only.
  • Updates docs (docs/SPEC.md, packages/foundry-ai/docs/model-support.md, usage.md, READMEs, skill references) to reflect embeddings support and add an embed/embedMany usage example.
  • Promotes the live-harness OpenAI embedding probe into a parametrized first-class row covering both models, routed through the real provider (openai.embeddingModel(...)) instead of a standalone direct client.

Stacked on #43 (feat/foundry-trace-context).

Note: the branch initially shipped with alias->RID resolution for embeddings (mirroring the language-model pattern). A live probe against the real Foundry embeddings proxy showed that model routing is plain-string-only for embeddings (RIDs 404, plain strings 200), so a follow-up commit (c027750) corrected this before review.

Test plan

  • pnpm run format
  • pnpm exec nx run-many -t identity-check release-policy-check lint test typecheck build skills-validate package-audit --projects=foundry-ai --outputStyle=static --skip-nx-cache — all 8 targets pass (54/54 unit tests)
  • Live smoke: embed() against the real Foundry proxy for both text-embedding-3-small (1536 dims) and text-embedding-3-large (3072 dims) — both return HTTP 200 with real vectors after the plain-model-string fix.
  • Merge decision left to reviewer (not auto-merged per instructions)

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@anandpant
anandpant force-pushed the feat/openai-embeddings branch from c027750 to fcb4bfc Compare July 12, 2026 00:03
anandpant added a commit that referenced this pull request Jul 12, 2026
…us-4.7/4.8, gemini-3.5-flash

Adds exactly six new language-model catalog entries, all RIDs live-confirmed
against the Foundry proxy:

- OpenAI: gpt-5.5 (full chat+responses transport, modeled after gpt-5.4),
  gpt-5-pro (Responses-API-only reasoning tier), gpt-5.3-codex
  (Responses-API-only, succeeds gpt-5.1-codex directly)
- Anthropic: claude-opus-4.7, claude-opus-4.8 (version-first RID slug order,
  modeled after claude-opus-4.6)
- Google: gemini-3.5-flash (modeled after the gemini-3.x family)

Explicitly excludes gpt-5.1-codex-max and gpt-5.2-codex, deprecated by the
Foundry proxy as of 2026-07-09.

RID/modelIdentifier/displayName/alias values are authoritative (live-confirmed
by the team). lifecycle, trainingCutoffDate, performance tier, and externalUrl
were pattern-matched against each model's nearest sibling in the same
provider family.

Adds catalog.test.ts spot-checks for the new models plus a negative-space
check that the two excluded codex RIDs remain unknown. Updates
model-support.md's known-alias lists and notes that gpt-5-pro/gpt-5.3-codex
are Responses-API-only, consistent with this package's existing OpenAI
Responses-only transport. No embedding entries touched (those are complete
in the base branch, PR #44).

Verification: pnpm run format, and nx run-many -t identity-check
release-policy-check lint test typecheck build skills-validate package-audit
--projects=foundry-ai all pass (54/54 package tests).
anandpant added a commit that referenced this pull request Jul 12, 2026
…us-4.7/4.8, gemini-3.5-flash

Adds exactly six new language-model catalog entries, all RIDs live-confirmed
against the Foundry proxy:

- OpenAI: gpt-5.5 (full chat+responses transport, modeled after gpt-5.4),
  gpt-5-pro (Responses-API-only reasoning tier), gpt-5.3-codex
  (Responses-API-only, succeeds gpt-5.1-codex directly)
- Anthropic: claude-opus-4.7, claude-opus-4.8 (version-first RID slug order,
  modeled after claude-opus-4.6)
- Google: gemini-3.5-flash (modeled after the gemini-3.x family)

Explicitly excludes gpt-5.1-codex-max and gpt-5.2-codex, deprecated by the
Foundry proxy as of 2026-07-09.

RID/modelIdentifier/displayName/alias values are authoritative (live-confirmed
by the team). lifecycle, trainingCutoffDate, performance tier, and externalUrl
were pattern-matched against each model's nearest sibling in the same
provider family.

Adds catalog.test.ts spot-checks for the new models plus a negative-space
check that the two excluded codex RIDs remain unknown. Updates
model-support.md's known-alias lists and notes that gpt-5-pro/gpt-5.3-codex
are Responses-API-only, consistent with this package's existing OpenAI
Responses-only transport. No embedding entries touched (those are complete
in the base branch, PR #44).

Verification: pnpm run format, and nx run-many -t identity-check
release-policy-check lint test typecheck build skills-validate package-audit
--projects=foundry-ai all pass (54/54 package tests).
@anandpant
anandpant force-pushed the feat/foundry-trace-context branch from e49af23 to 0429b4c Compare July 12, 2026 22:14
@anandpant
anandpant force-pushed the feat/openai-embeddings branch from fcb4bfc to 70e7bc0 Compare July 12, 2026 22:14

anandpant commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 12, 10:18 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 12, 10:23 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 12, 10:23 PM UTC: @anand-testcompare merged this pull request with Graphite.

@anandpant
anandpant changed the base branch from feat/foundry-trace-context to graphite-base/44 July 12, 2026 22:20
@anandpant
anandpant changed the base branch from graphite-base/44 to main July 12, 2026 22:21
…ead of RIDs

A live probe against the Foundry embeddings proxy confirmed it takes a plain
OpenAI model string in the request body (e.g. "text-embedding-3-small"), not
a Foundry RID like the language-model endpoints. Unlike language models, the
embeddings proxy has no RID concept: known aliases now resolve to themselves
and any other model string passes through unchanged, mirroring the spirit of
raw-RID passthrough on the language-model path.
@anandpant
anandpant force-pushed the feat/openai-embeddings branch from 70e7bc0 to f937805 Compare July 12, 2026 22:22
@anandpant
anandpant merged commit 51ad227 into main Jul 12, 2026
5 checks passed
@anandpant
anandpant deleted the feat/openai-embeddings branch July 12, 2026 22:23
anandpant added a commit that referenced this pull request Jul 12, 2026
…us-4.7/4.8, gemini-3.5-flash

Adds exactly six new language-model catalog entries, all RIDs live-confirmed
against the Foundry proxy:

- OpenAI: gpt-5.5 (full chat+responses transport, modeled after gpt-5.4),
  gpt-5-pro (Responses-API-only reasoning tier), gpt-5.3-codex
  (Responses-API-only, succeeds gpt-5.1-codex directly)
- Anthropic: claude-opus-4.7, claude-opus-4.8 (version-first RID slug order,
  modeled after claude-opus-4.6)
- Google: gemini-3.5-flash (modeled after the gemini-3.x family)

Explicitly excludes gpt-5.1-codex-max and gpt-5.2-codex, deprecated by the
Foundry proxy as of 2026-07-09.

RID/modelIdentifier/displayName/alias values are authoritative (live-confirmed
by the team). lifecycle, trainingCutoffDate, performance tier, and externalUrl
were pattern-matched against each model's nearest sibling in the same
provider family.

Adds catalog.test.ts spot-checks for the new models plus a negative-space
check that the two excluded codex RIDs remain unknown. Updates
model-support.md's known-alias lists and notes that gpt-5-pro/gpt-5.3-codex
are Responses-API-only, consistent with this package's existing OpenAI
Responses-only transport. No embedding entries touched (those are complete
in the base branch, PR #44).

Verification: pnpm run format, and nx run-many -t identity-check
release-policy-check lint test typecheck build skills-validate package-audit
--projects=foundry-ai all pass (54/54 package tests).
anandpant added a commit that referenced this pull request Jul 12, 2026
…us-4.7/4.8, gemini-3.5-flash (#45)

## Summary

Stacks on #44. Adds exactly six new language-model catalog entries, all RIDs live-confirmed against the Foundry proxy per the team's RID probe:

- **OpenAI**: `gpt-5.5` (full chat+responses transport, modeled after `gpt-5.4`), `gpt-5-pro` (Responses-API-only reasoning tier), `gpt-5.3-codex` (Responses-API-only, succeeds `gpt-5.1-codex` directly)
- **Anthropic**: `claude-opus-4.7`, `claude-opus-4.8` (version-first RID slug order — `anthropic-claude-4-7-opus` / `anthropic-claude-4-8-opus` — confirmed live)
- **Google**: `gemini-3.5-flash` (live-confirmed via SDK path)

Explicitly **excludes** `gpt-5.1-codex-max` and `gpt-5.2-codex`, deprecated by the Foundry proxy as of 2026-07-09 (confirmed via proxy error).

RID / `modelIdentifier` / `displayName` / alias values are authoritative (live-confirmed by the team, not guessed). `lifecycle`, `trainingCutoffDate`, `performance` tier, and `externalUrl` were pattern-matched against each model's nearest sibling in the same provider family, since those fields are informational/display-only and not independently verifiable the same way RIDs are.

No embedding entries touched — that work is complete in the base branch (#44), which already routes embeddings via plain model-string passthrough rather than RID resolution.

## Changes

- `packages/foundry-ai/src/models/openai-models.ts`: 3 new entries
- `packages/foundry-ai/src/models/anthropic-models.ts`: 2 new entries
- `packages/foundry-ai/src/models/google-models.ts`: 1 new entry
- `packages/foundry-ai/src/__tests__/catalog.test.ts`: spot-checks for the new models across all three providers, plus a negative-space check confirming the two excluded/deprecated codex RIDs remain unknown
- `packages/foundry-ai/docs/model-support.md`: known-alias lists updated, plus a note that `gpt-5-pro`/`gpt-5.3-codex` are Responses-API-only, consistent with this package's existing OpenAI Responses-only transport

## Test plan

- [x] `pnpm run format` — passes (only the pre-existing, unrelated biome schema-version notice)
- [x] `pnpm exec nx run-many -t identity-check release-policy-check lint test typecheck build skills-validate package-audit --projects=foundry-ai --outputStyle=static --skip-nx-cache` — all 8 targets pass
- [x] Full package test suite: 54/54 tests pass (7 test files)
- [x] Manually diffed every new catalog entry against the exact RID/alias mappings before committing
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