Thin Palantir Foundry provider adapters and model catalog for the Vercel AI SDK.
- Routes AI SDK language-model calls and OpenAI embeddings through Foundry's provider-compatible proxy endpoints.
- Maps friendly model names such as
gpt-5-mini,claude-sonnet-4.6, andgemini-3.1-flash-liteto Foundry RIDs. - Keeps installs lean through provider-specific subpaths for OpenAI, Anthropic, and Google.
- Ships a TanStack Intent skill plus a small set of provider-specific reference examples.
- Verifies the public alias catalog with a live Foundry capability harness instead of hand-waving support claims.
loadFoundryConfig()resolves the proxy base URL, token, and optional attribution header from environment variables.- Provider factories such as
createFoundryOpenAI()adapt AI SDK provider clients to Foundry-compatible endpoints and request constraints. - The package exposes a normalized model catalog for current aliases, but still lets you pass a raw Foundry RID when your stack has a newer enrollment.
- Multi-provider routing stays in application code with AI SDK
createProviderRegistry; the package deliberately does not ship its own registry wrapper.
Install the package, ai, and only the provider peer dependency you need:
pnpm add @nyrra/foundry-ai ai @ai-sdk/openaiFOUNDRY_URL=https://your-stack.palantirfoundry.com
FOUNDRY_TOKEN=your-token
FOUNDRY_ATTRIBUTION_RID=
FOUNDRY_TRACE_PARENT=
FOUNDRY_TRACE_STATE=import { loadFoundryConfig } from '@nyrra/foundry-ai';
import { createFoundryOpenAI } from '@nyrra/foundry-ai/openai';
import { generateText } from 'ai';
const openai = createFoundryOpenAI(loadFoundryConfig());
const { text } = await generateText({
model: openai('gpt-5-mini'),
prompt: 'Reply in one sentence.',
});
console.log(text);See the published package README for the npm-facing surface: packages/foundry-ai/README.md.
The repository lives at shpitdev/foundry-ai, while releases continue under the existing @nyrra/foundry-ai npm package. Consumers keep the same dependency, imports, root exports, provider subpaths, FOUNDRY_* variables, model aliases, and raw-RID behavior.
Install the published agent skill with:
npx skills add https://github.com/shpitdev/foundry-ai --skill foundry-ai-providerThat flow lets the skills CLI prompt for scope and agent links interactively. The install event is what skills.sh uses for leaderboard/indexing.
| Layer | Present | Tooling | Runs in CI |
|---|---|---|---|
| unit | yes | Vitest | yes |
| integration | no | none | no |
| e2e api | yes | live Vitest harness + manual Bun example scripts against Foundry | no |
| e2e web | no | none | no |
e2e api coverage exists, but it is intentionally not in CI because it requires live Foundry credentials and proxy access.
CI runs lint, unit tests, typecheck, build, TanStack Intent validation, and a package-content audit. The checked-in results in packages/foundry-ai/docs/harness-capability-results.md are harness output, not a blanket support promise.
- AI SDK DevTools is wired into the live harness and the advanced DevTools instrumentation examples. The middleware captures every
streamTextcall — tool invocations, results, token usage, and full request/response payloads — into.devtools/generations.json. Start the viewer in a separate terminal withnpx @ai-sdk/devtoolsand openhttp://localhost:4983. For the live harness:pnpm run test:live:devtools -- --no-update-docs --model openai:gpt-5-nanoorjust live-model openai:gpt-5-nano. For the advanced examples:pnpm run example:devtoolsorpnpm run example:devtools:parallel. - TanStack Intent validates the published skill surface with
pnpm exec intent validate packages/foundry-ai/skills. - In consumer repos, TanStack Intent discovers the installed package from
node_modules. After adding@nyrra/foundry-aito the app, runnpx @tanstack/intent@latest listand mapnode_modules/@nyrra/foundry-ai/skills/foundry-ai-provider/SKILL.mdin your agent config. - The safe example runner builds first and then executes with Bun when available. Start with
pnpm run example tool-calling openai,bun run example:devtools, orbun run example:devtools:parallel.
- Package README
- Usage guide
- Model support
- Dependency strategy
- Harness capability results
- AI SDK community provider draft
- TanStack Intent skill
- Examples overview
Base examples live under examples/base, which is a symlink to the published skill reference examples. Advanced repo-only examples live under examples/advanced.
Stable releases and prereleases run through Nx and the shared GitHub Actions workflow using npm trusted publishing and provenance. Publishing remains disabled until the existing package trusts shpitdev/foundry-ai. See docs/RELEASING.md.
- Required: a Palantir Foundry stack with access to the LLM proxy endpoints.
- Optional: Exa for the advanced tool-calling examples.
Copyright 2026 SHPIT LLC