Docs
CodeRabbit
Cloudflare
Railway
AG Grid
WorkOS
SerpAPI
OpenRouter
Netlify
Clerk
Prisma
Electric
Sentry
Unkey
CodeRabbit
Cloudflare
Railway
AG Grid
WorkOS
SerpAPI
OpenRouter
Netlify
Clerk
Prisma
Electric
Sentry
Unkey
Class References
Function References
Interface References
Type Alias References
Variable References

ExtendedModelDef

Interface: ExtendedModelDef<TName, TInput, TOptions, TFeatures, TTools>

Defined in: packages/ai/src/extend-adapter.ts:21

Definition for a custom model to add to an adapter.

Example

typescript
const customModels = [
  createModel('my-custom-model', ['text', 'image']),
] as const
const customModels = [
  createModel('my-custom-model', ['text', 'image']),
] as const

Type Parameters

TName

TName extends string = string

The model name as a literal string type

TInput

TInput extends ReadonlyArray<Modality> = ReadonlyArray<Modality>

Array of supported input modalities

TOptions

TOptions = unknown

Provider options type for this model

TFeatures

TFeatures extends ReadonlyArray<string> = ReadonlyArray<string>

TTools

TTools extends ReadonlyArray<string> = ReadonlyArray<string>

Properties

features?

ts
optional features: TFeatures;
optional features: TFeatures;

Defined in: packages/ai/src/extend-adapter.ts:35

Optional declared features (e.g. 'reasoning', 'structured_outputs')


input

ts
input: TInput;
input: TInput;

Defined in: packages/ai/src/extend-adapter.ts:31

Supported input modalities for this model


modelOptions

ts
modelOptions: TOptions;
modelOptions: TOptions;

Defined in: packages/ai/src/extend-adapter.ts:33

Type brand for provider options - use {} as YourOptionsType


name

ts
name: TName;
name: TName;

Defined in: packages/ai/src/extend-adapter.ts:29

The model name identifier


tools?

ts
optional tools: TTools;
optional tools: TTools;

Defined in: packages/ai/src/extend-adapter.ts:37

Optional declared provider tools (e.g. 'web_search')