---
title: Nyrra Foundry AI
description: Learn how to use @nyrra/foundry-ai to access Palantir Foundry LLM proxy endpoints from the AI SDK.
---

# Nyrra Foundry AI

The [`@nyrra/foundry-ai`](https://www.npmjs.com/package/@nyrra/foundry-ai) community provider routes AI SDK language-model requests through Palantir Foundry's provider-compatible proxy endpoints.

Use it when you want local development and deployed server workloads to call secure/private Foundry endpoints while keeping AI SDK application code and provider-specific request shapes.

## Key Features

- Secure/private Foundry proxy endpoints for local development and deployed server workloads
- OpenAI, Anthropic, and Google adapters with one shared alias-to-RID catalog
- Application-level multi-provider routing with AI SDK `createProviderRegistry`
- Explicit Foundry compatibility handling for OpenAI and Google proxy behavior

## Version Compatibility

| Provider Version | AI SDK Version | Status |
|---|---|---|
| 0.x | v6 | Preview |

## Setup

Install the package, `ai`, and only the provider peer dependency you need:

<Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>
  <Tab>
    <Snippet text="pnpm add @nyrra/foundry-ai ai @ai-sdk/openai" dark />
  </Tab>
  <Tab>
    <Snippet text="npm install @nyrra/foundry-ai ai @ai-sdk/openai" dark />
  </Tab>
  <Tab>
    <Snippet text="yarn add @nyrra/foundry-ai ai @ai-sdk/openai" dark />
  </Tab>
  <Tab>
    <Snippet text="bun add @nyrra/foundry-ai ai @ai-sdk/openai" dark />
  </Tab>
</Tabs>

Swap `@ai-sdk/openai` for `@ai-sdk/anthropic` or `@ai-sdk/google` when you use those provider entrypoints. Install multiple peers only when your app actually routes to multiple providers.

## Environment

Set the Foundry enrollment URL and token in your server runtime:

```bash
FOUNDRY_URL=https://your-stack.palantirfoundry.com
FOUNDRY_TOKEN=your-token
FOUNDRY_ATTRIBUTION_RID=
```

`FOUNDRY_ATTRIBUTION_RID` is optional.

## Provider instance

Import the root config helper plus the provider-specific subpath you need:

```ts
import { loadFoundryConfig } from '@nyrra/foundry-ai';
import { createFoundryOpenAI } from '@nyrra/foundry-ai/openai';

const openai = createFoundryOpenAI(loadFoundryConfig());
```

Other entrypoints:

- `@nyrra/foundry-ai/anthropic`
- `@nyrra/foundry-ai/google`

## Language models

Model IDs can be either:

- a known alias such as `gpt-5-mini`, `claude-sonnet-4.6`, or `gemini-3.1-flash-lite`
- a raw Foundry language model RID such as `ri.language-model-service..language-model.gpt-5-2`

Known aliases resolve through the package catalog. Raw RIDs pass through unchanged when you call a provider factory directly.

## Example

```ts
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: 'Summarize why Foundry model aliases are useful.',
});

console.log(text);
```

## Multi-provider routing

The package does not export a registry helper. Compose one in application code with AI SDK `createProviderRegistry`:

```ts
import { loadFoundryConfig } from '@nyrra/foundry-ai';
import { createFoundryAnthropic } from '@nyrra/foundry-ai/anthropic';
import { createFoundryOpenAI } from '@nyrra/foundry-ai/openai';
import { createProviderRegistry } from 'ai';

const config = loadFoundryConfig();

const registry = createProviderRegistry({
  anthropic: createFoundryAnthropic(config),
  openai: createFoundryOpenAI(config),
});
```

## Foundry-specific behavior

- OpenAI traffic always uses Foundry-safe compatibility defaults where required.
- `providerOptions.openai.store = true` throws before the request is sent.
- Known OpenAI reasoning aliases automatically get `providerOptions.openai.forceReasoning = true` unless the caller already set it.
- Google support is backed by Foundry's beta Google-compatible proxy.
- The package currently exposes language-model methods only.

## Model Capabilities

These tables reflect the latest checked-in harness capability snapshot for one Foundry stack, not raw enrollment metadata. The package catalog derives flags such as `supportsVision` from Foundry `inputTypes`, so a model can advertise a capability in metadata even when the current stack still fails that harness check. `-` means the capability is intentionally not asserted or is out of scope for the current stack.

### OpenAI

| Model | Text | Stream | Structured | Tools | Vision | Reasoning |
|---|---|---|---|---|---|---|
| `gpt-5.4-nano` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-5.4-mini` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-5.4` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-5.2` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-5.1-codex-mini` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gpt-5.1-codex` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gpt-5.1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gpt-5-nano` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-5-mini` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-5-codex` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gpt-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-4.1-nano` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gpt-4.1-mini` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gpt-4.1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `o4-mini` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `gpt-4o` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `o3` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> |

### Anthropic

| Model | Text | Stream | Structured | Tools | Vision | Reasoning |
|---|---|---|---|---|---|---|
| `claude-sonnet-4.6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `claude-opus-4.6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> |
| `claude-sonnet-4.5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> |
| `claude-opus-4.5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Cross size={18} /> |
| `claude-haiku-4.5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> |
| `claude-opus-4.1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Cross size={18} /> |
| `claude-sonnet-4` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Cross size={18} /> |
| `claude-opus-4` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Cross size={18} /> |
| `claude-3.7-sonnet` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> |
| `claude-3.5-haiku` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> |

### Google

| Model | Text | Stream | Structured | Tools | Vision | Reasoning |
|---|---|---|---|---|---|---|
| `gemini-3.1-pro` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gemini-3.1-flash-lite` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gemini-3-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gemini-2.5-pro` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gemini-2.5-flash-lite` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |
| `gemini-2.5-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | - |

These tables summarize the latest checked-in harness snapshot. For row-level notes and durations, see the full harness capability results.

## Limitations

- Verified today for env-based server usage.
- Not yet validated end to end in Palantir TSv1/TSv2 standalone functions.
- Not yet validated with `@osdk/client` / `PlatformClient` fetch wiring.
- Embeddings, image generation, speech, transcription, video, and rerank methods are not exposed by this package yet.

## Additional resources

- [Package README](https://github.com/nyrra-labs/nyrra-foundry-ai/tree/main/packages/foundry-ai#readme)
- [Usage guide](https://github.com/nyrra-labs/nyrra-foundry-ai/blob/main/packages/foundry-ai/docs/usage.md)
- [Model support guide](https://github.com/nyrra-labs/nyrra-foundry-ai/blob/main/packages/foundry-ai/docs/model-support.md)
- [Harness capability results](https://github.com/nyrra-labs/nyrra-foundry-ai/blob/main/packages/foundry-ai/docs/harness-capability-results.md)
- [Palantir LLM-provider compatible APIs](https://www.palantir.com/docs/foundry/aip/llm-provider-compatible-apis/)
