@kmlckj/licos-dev-sdk
v0.2.14
Published
LICOS Dev SDK for server-side model capability calls
Readme
LICOS Dev SDK for Node.js
Server-side model capability clients for LICOS coding projects.
Do not import this package from browser/client code. It resolves the project owner's user token through the LICOS runtime identity and sends authenticated requests to platform APIs.
Install
npm install @kmlckj/licos-dev-sdkThe LICOS runtime provides platform identity and project owner context. Project code should not hard-code tokens, model base URLs, or provider keys.
For model selection, omit model or pass auto to use the first matching model from the platform model capability catalog. Pass a concrete model ID only when the user explicitly chooses one.
Chat
import { LLMClient } from '@kmlckj/licos-dev-sdk';
const client = new LLMClient();
const result = await client.invoke('Write a short product summary.');
console.log(result.text);Image Generation
import { ImageGenerationClient } from '@kmlckj/licos-dev-sdk';
const result = await new ImageGenerationClient().generate('A clean blue sky over a modern city', {
count: 1,
size: '1024x1024',
});
console.log(result.urls);Use imageUrl, image, or filePath when the task needs image-to-image generation from a reference image. Local files are encoded by the SDK before the request is sent.
const result = await new ImageGenerationClient().generate('Keep the object shape and change the background to a clean blue sky', {
imageUrl: 'https://example.com/source.png',
filePath: './assets/reference.png',
count: 1,
});
console.log(result.urls);Video Generation
import { VideoGenerationClient } from '@kmlckj/licos-dev-sdk';
const result = await new VideoGenerationClient().generate('A slow aerial shot over a futuristic harbor', {
parameters: { duration: 5, ratio: '16:9' },
});
console.log(result.url);Vision Understanding
import { VisionClient } from '@kmlckj/licos-dev-sdk';
const result = await new VisionClient().understand({
imageUrl: 'https://example.com/image.png',
prompt: 'Describe the image in one paragraph.',
});
console.log(result.text);imageUrl can also be a data:image/...;base64,... URI, plain Base64 image data, or use filePath for a local image file.
Speech Recognition
import { SpeechRecognitionClient } from '@kmlckj/licos-dev-sdk';
const result = await new SpeechRecognitionClient().recognize({
audioUrl: 'https://example.com/audio.mp3',
});
console.log(result.text);audioUrl can also be a data:audio/...;base64,... URI, plain Base64 audio data, or use filePath for a local audio file.
Observability
import { logInfo, recordMetric, recordTrace } from '@kmlckj/licos-dev-sdk';
await logInfo('Application started');
await recordMetric({
route: '/stream_run',
method: 'POST',
latencyMs: 320,
statusCode: 200,
});
await recordTrace({
traceId: 'trace-001',
input: { query: 'hello' },
output: { answer: 'hi' },
latencySeconds: 1.2,
});