@nyrra/foundry-ai
v0.0.5
Published
Thin Palantir Foundry provider adapters and model catalog for the Vercel AI SDK.
Maintainers
Readme
@nyrra/foundry-ai
Thin Palantir Foundry provider adapters and model catalog for the Vercel AI SDK.
What It Does
- Routes AI SDK language-model calls and OpenAI embeddings through Foundry's provider-compatible proxy endpoints.
- Maps friendly model aliases such as
gpt-5-mini,claude-sonnet-4.6, andgemini-3.1-flash-liteto Foundry RIDs. - Keeps installs lean by exposing provider-specific subpaths and optional peer dependencies.
- Ships a TanStack Intent skill for provider-specific setup and troubleshooting.
Install
Install ai, this package, and only the provider peer dependency you need:
pnpm add @nyrra/foundry-ai ai @ai-sdk/openaipnpm add @nyrra/foundry-ai ai @ai-sdk/anthropicpnpm add @nyrra/foundry-ai ai @ai-sdk/googleIf you use more than one provider, install both peers. For the rationale and bundle-size tradeoffs, see the dependency strategy guide.
Package Identity
The source repository is shpitdev/foundry-ai; the existing npm identity remains @nyrra/foundry-ai. Consumers do not need to change their dependency or imports because of the repository transfer. Releases are published from GitHub Actions with npm provenance.
Agent Skill
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. In TanStack Intent consumer repos, install @nyrra/foundry-ai directly, run npx @tanstack/intent@latest list, and map node_modules/@nyrra/foundry-ai/skills/foundry-ai-provider/SKILL.md in your agent config.
Verified Use Case
Use this package when you want local development and deployed server workloads to call secure or private Foundry proxy endpoints instead of public provider endpoints directly.
The verified path today is env-based server usage with FOUNDRY_URL and FOUNDRY_TOKEN. Palantir documents the same proxy family for OSDK and other Foundry-native runtimes, but this package has not yet been validated end to end in Palantir TSv1 or TSv2 standalone functions or PlatformClient-driven fetch flows.
Quick Start
FOUNDRY_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 result = await generateText({
model: openai('gpt-5-mini'),
prompt: 'Reply in one sentence.',
});
console.log(result.text);Provider Surface
- Root exports config loading, catalog helpers, errors, and model ID types.
@nyrra/foundry-ai/openaiexportscreateFoundryOpenAI.@nyrra/foundry-ai/anthropicexportscreateFoundryAnthropic.@nyrra/foundry-ai/googleexportscreateFoundryGoogle.- There is no package-level registry helper. Compose multi-provider routing in application code with AI SDK
createProviderRegistry.
Model IDs
- Use friendly aliases for catalogued models such as
gpt-5-mini,claude-sonnet-4.6, andgemini-3.1-flash-lite. - Use raw Foundry RIDs when your stack exposes a model that is not yet in the package catalog.
- Sunset and deprecated enrollment entries are intentionally excluded from the public alias catalog.
getModelMetadata()exposes normalized catalog data for current aliases, includingmodelIdentifier,inputTypes,trainingCutoffDate,performance, and derivedsupportsVision/supportsResponsesflags.- Alias and raw-RID behavior are documented in the model support guide.
Foundry-Specific Behavior
- OpenAI traffic always uses Foundry-safe compatibility defaults where required.
providerOptions.openai.store=truethrows before the request is sent.- Known OpenAI reasoning aliases automatically get
providerOptions.openai.forceReasoning=trueunless the caller already set it. - The Google adapter rewrites the AI SDK's
x-goog-api-keyauth into the bearer-token header that Foundry expects. - OpenAI
embeddingModel()andembedding()provide typed aliases fortext-embedding-3-smallandtext-embedding-3-large, while other plain OpenAI model strings pass through unchanged. Embeddings do not use Foundry RID routing. Other embedding providers and image, audio, video, and rerank methods are not exposed.
Docs And Examples
- Usage guide
- Model support guide
- Dependency strategy guide
- Harness capability results
- AI SDK community provider draft
- TanStack Intent skill
- Examples overview
- Published base examples
Testing And CI
| Layer | Present | Tooling | Runs in CI | |---|---|---|---| | unit | yes | Vitest | yes | | integration | no | none | no | | e2e api | yes | live Vitest suite + manual example scripts against Foundry | no | | e2e web | no | none | no |
CI runs lint, unit tests, typecheck, build, TanStack Intent skill validation, and a package-content audit. The harness matrix remains manual through pnpm test:live.
Copyright And License
Copyright 2026 SHPIT LLC
