Open Models
Interact with custom or fine-tuned models using their unique identifier directly through the Knowledgator TypeScript SDK.
Available Modules
- Generic Prediction — Call a model's base endpoint with a raw input payload.
- Method-based Inference — Invoke a specific named method on a model.
Example Usage
import { createClient } from '@knowledgator/typescript-sdk';
const kg = createClient('YOUR_API_KEY');
// Initialize the model client
const model = kg.model('your-model-id');
// Generic prediction
const response = await model.predict({
input: 'text to process'
});
console.log(response);
// Method-based inference
const generator = kg.model('your-model-id', 'generate');
const result = await generator.predict({
prompt: 'Tell me a story about a brave knight.'
});
console.log(result);