Skip to Content

AI overview

Packages for adding LLM features to OSDK apps with Foundry's Language Model Service, what each one does, and what you need before you start.

Foundry docsAIP

Add text generation, tool calling, chat UIs, and agents to an OSDK app using models hosted by Foundry's Language Model Service (LMS). Requests run with the signed-in user's permissions and Foundry's governance and usage tracking, so you never ship a provider API key.

These packages are pre-release. @osdk/aip-core, @osdk/language-models, and @osdk/agents are at version 0.x, and the React APIs ship from /experimental entry points. Expect breaking changes in minor releases.

Packages

PackageImportWhat it doesMaturity
@osdk/aip-core@osdk/aip-corefoundryModel, generateText, streamText, tool definitions, and the LmsChatTransport chat transport.0.x
@osdk/aip-core@osdk/aip-core/ai-sdkcreateFoundryAI, a Foundry provider for the AI SDK version 6.0.x
@osdk/language-models@osdk/language-modelsProxy base URLs and an authenticated fetch for the OpenAI, Anthropic, and Google SDKs. @osdk/aip-core is built on it.0.x
@osdk/react@osdk/react/experimental/aipuseChat, a hook that streams a conversation into React state.Experimental
@osdk/react-components@osdk/react-components/experimental/aip-agent-chatAipAgentChat, a prebuilt chat panel built on useChat.Experimental
@osdk/foundry.aipagents@osdk/foundry.aipagentsPlatform SDK for agents built in AIP Agent Studio: sessions, blocking and streaming replies.Beta endpoints
@osdk/agents@osdk/agents, @osdk/agents/experimentalAgentConfig and the injected getClient and getPlatformClient for code that runs inside an agent.0.x

Which to use

GoalStart with
Summarize, classify, or draft text from a script or servergenerateText in Node.js
Show an answer token by tokenstreamText
Let the model look up Ontology data or propose actionsTool calling
Add a chat panel to a React app with no custom UIAipAgentChat
Build your own chat UIuseChat
Use the AI SDK's helpers, Zod tools, and multi-step loop@osdk/aip-core/ai-sdk
Call an OpenAI, Anthropic, or Google SDK feature that @osdk/aip-core lacks@osdk/language-models
Talk to an agent configured in AIP Agent StudioAgents

@osdk/language-models is not superseded: @osdk/aip-core depends on it for the proxy URL. Use @osdk/aip-core for a provider-neutral API, and @osdk/language-models when you want a provider's own SDK.

Prerequisites

RequirementDetails
AIP on your enrollmentAIP must be enabled, and your users need permission to use AIP builder capabilities.
OAuth scopeThird-party applications must request api:use-language-models-execute. The default scopes of createPublicOauthClient do not include it. Agents need api:aip-agents-read and api:aip-agents-write, or api:agents-read and api:agents-write for generated agents.
A PlatformClientfoundryModel, createFoundryAI, and AipAgentChat take a client from createPlatformClient, not the Ontology Client. Create it with the same token provider.
A modelUse a model API name, such as "gpt-4o", or a registered model RID. Available models vary by enrollment; look them up in Model Catalog.
src/model.ts
import { foundryModel } from "@osdk/aip-core";
import { createPlatformClient } from "@osdk/client";
import { createPublicOauthClient } from "@osdk/oauth";

const foundryUrl = "https://example.palantirfoundry.com";

const auth = createPublicOauthClient(
  "<your-client-id>",
  foundryUrl,
  "http://localhost:8080/auth/callback",
  {
    scopes: [
      "api:read-data",
      "api:write-data",
      "api:use-ontologies-read",
      "api:use-ontologies-write",
      "api:use-language-models-execute",
    ],
  },
);

export const platformClient = createPlatformClient(foundryUrl, auth);
export const model = foundryModel({ client: platformClient, model: "gpt-4o" });

Current limits

LimitApplies to
One model call per request; you run the tool loop yourself.generateText, streamText
Tool inputSchema must be JSON Schema; Zod schemas are not converted.generateText, streamText
Text only: image and file parts are dropped, with a warning in @osdk/aip-core and silently in useChat.@osdk/aip-core, useChat
No structured JSON output, no topK.@osdk/aip-core, @osdk/aip-core/ai-sdk
No tools, multi-step loops, or stream resume.useChat, AipAgentChat

The AI SDK provider lifts the first two: the AI SDK runs the loop and converts Zod schemas.

On this page