Llm.Models
Overview
Available Operations
- list - List available models
- get - Retrieve a model
- addRegistryModel - Add a model to the registry
- listRegistryModels - List all registry models
- updateRegistryModel - Update a database model in the registry
- removeRegistryModel - Remove a database model from the registry
- getRegistryModel - Get a specific registry model
- checkRegistryModelHealth - Check health of a specific model
list
Lists the currently available models. Provides basic information about each model including its ID and owner.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.list();
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsList } from "@meetkai/mka1/funcs/llmModelsList.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsList(sdk);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsList failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmModelsList,
useLlmModelsListSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmModelsList,
// Utility to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAllLlmModelsList,
} from "@meetkai/mka1/react-query/llmModelsList.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListModelsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
get
Retrieves a model instance, providing basic information about the model such as the owner and supported capabilities.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.get({
modelId: "meetkai:functionary-urdu-mini-pak",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsGet } from "@meetkai/mka1/funcs/llmModelsGet.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsGet(sdk, {
modelId: "meetkai:functionary-urdu-mini-pak",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsGet failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmModelsGet,
useLlmModelsGetSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmModelsGet,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmModelsGet,
invalidateAllLlmModelsGet,
} from "@meetkai/mka1/react-query/llmModelsGet.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetModelRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetModelResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
addRegistryModel
Adds a new database-sourced model to the registry. YAML models cannot be overridden.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.addRegistryModel({
id: "meetkai:my-custom-chat-v1",
provider: "openai-compatible",
modelId: "my-custom-chat-v1",
displayName: "My Custom Chat v1",
baseUrl: "https://models.example.com/v1",
apiFormat: "responses",
created: 1704067200,
auth: {
type: "api-key",
envVar: "CUSTOM_MODEL_API_KEY",
},
capabilities: {
modalities: {
input: [
"text",
],
output: [
"text",
],
},
reasoning: true,
supportsTemperature: true,
supportsTopP: true,
},
contextWindow: 131072,
rpm: 120,
defaultParams: {
temperature: 0.2,
topP: 0.95,
},
hidden: false,
healthCheck: {
url: "https://models.example.com/health",
method: "GET",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsAddRegistryModel } from "@meetkai/mka1/funcs/llmModelsAddRegistryModel.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsAddRegistryModel(sdk, {
id: "meetkai:my-custom-chat-v1",
provider: "openai-compatible",
modelId: "my-custom-chat-v1",
displayName: "My Custom Chat v1",
baseUrl: "https://models.example.com/v1",
apiFormat: "responses",
created: 1704067200,
auth: {
type: "api-key",
envVar: "CUSTOM_MODEL_API_KEY",
},
capabilities: {
modalities: {
input: [
"text",
],
output: [
"text",
],
},
reasoning: true,
supportsTemperature: true,
supportsTopP: true,
},
contextWindow: 131072,
rpm: 120,
defaultParams: {
temperature: 0.2,
topP: 0.95,
},
hidden: false,
healthCheck: {
url: "https://models.example.com/health",
method: "GET",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsAddRegistryModel failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmModelsAddRegistryModelMutation
} from "@meetkai/mka1/react-query/llmModelsAddRegistryModel.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | components.AddRegistryModelRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.RegistryModelResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listRegistryModels
Lists all models in the registry with full details including source and health status.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.listRegistryModels();
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListRegistryModels } from "@meetkai/mka1/funcs/llmModelsListRegistryModels.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsListRegistryModels(sdk);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsListRegistryModels failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmModelsListRegistryModels,
useLlmModelsListRegistryModelsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmModelsListRegistryModels,
// Utility to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAllLlmModelsListRegistryModels,
} from "@meetkai/mka1/react-query/llmModelsListRegistryModels.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.RegistryModelListResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
updateRegistryModel
Partially updates a database-sourced model. Only provided fields are changed; omitted fields are preserved. YAML models cannot be updated.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.updateRegistryModel({
id: "meetkai:my-custom-chat-v1",
updateRegistryModelRequest: {
displayName: "My Custom Chat v2",
rpm: 240,
defaultParams: {
temperature: 0.1,
topP: 0.9,
},
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsUpdateRegistryModel } from "@meetkai/mka1/funcs/llmModelsUpdateRegistryModel.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsUpdateRegistryModel(sdk, {
id: "meetkai:my-custom-chat-v1",
updateRegistryModelRequest: {
displayName: "My Custom Chat v2",
rpm: 240,
defaultParams: {
temperature: 0.1,
topP: 0.9,
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsUpdateRegistryModel failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmModelsUpdateRegistryModelMutation
} from "@meetkai/mka1/react-query/llmModelsUpdateRegistryModel.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.UpdateRegistryModelRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.RegistryModelResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
removeRegistryModel
Removes a database-sourced model. YAML models cannot be removed.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.removeRegistryModel({
id: "meetkai:my-custom-chat-v1",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsRemoveRegistryModel } from "@meetkai/mka1/funcs/llmModelsRemoveRegistryModel.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsRemoveRegistryModel(sdk, {
id: "meetkai:my-custom-chat-v1",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsRemoveRegistryModel failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmModelsRemoveRegistryModelMutation
} from "@meetkai/mka1/react-query/llmModelsRemoveRegistryModel.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.RemoveRegistryModelRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.DeleteRegistryModelResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getRegistryModel
Returns full model definition and health status for a specific model.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.getRegistryModel({
id: "meetkai:my-custom-chat-v1",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsGetRegistryModel } from "@meetkai/mka1/funcs/llmModelsGetRegistryModel.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsGetRegistryModel(sdk, {
id: "meetkai:my-custom-chat-v1",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsGetRegistryModel failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmModelsGetRegistryModel,
useLlmModelsGetRegistryModelSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmModelsGetRegistryModel,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmModelsGetRegistryModel,
invalidateAllLlmModelsGetRegistryModel,
} from "@meetkai/mka1/react-query/llmModelsGetRegistryModel.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetRegistryModelRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.RegistryModelResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
checkRegistryModelHealth
Probes the model's provider endpoint and updates health status.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.models.checkRegistryModelHealth({
id: "meetkai:my-custom-chat-v1",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsCheckRegistryModelHealth } from "@meetkai/mka1/funcs/llmModelsCheckRegistryModelHealth.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmModelsCheckRegistryModelHealth(sdk, {
id: "meetkai:my-custom-chat-v1",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmModelsCheckRegistryModelHealth failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmModelsCheckRegistryModelHealthMutation
} from "@meetkai/mka1/react-query/llmModelsCheckRegistryModelHealth.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CheckRegistryModelHealthRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.HealthCheckResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |