Scrydon
IntegrationsCapabilities

LLM

Implement the LLM capability — chat, completion, streaming, token estimation, dynamic model discovery.

For AI model providers (OpenAI, Anthropic, …). Implements chat / completion / streaming and optionally exposes a token estimator and a dynamic model fetcher.

Define the capability

import { defineCapabilityLLM } from "@scrydon/sdk-authoring/integrations/define";

const llmCapability = defineCapabilityLLM({
  models: [
    {
      id: "my-model-v1",
      pricing: { input: 3.0, output: 15.0 }, // per 1M tokens
      contextWindow: 128000,
      capabilities: {
        temperature: { min: 0, max: 2 },
        toolUsageControl: true,
        nativeStructuredOutputs: true,
      },
    },
  ],
  runtime: {
    async executeRequest(request, executor, logger) {
      const response = await fetch("https://api.example.com/v1/chat", {
        method: "POST",
        headers: {
          Authorization: `Bearer ${request.apiKey}`,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          model: request.model,
          messages: request.messages,
          temperature: request.temperature,
        }),
      });
      return await response.json();
    },
  },
  tokenEstimator: {
    avgCharsPerToken: 4,
    estimate(text) {
      return { count: Math.ceil(text.length / 4), confidence: "medium" };
    },
  },
  // Top-level on LLMCapabilityConfig — not nested under a wrapper.
  async fetchModels(config) {
    const response = await fetch("https://api.example.com/v1/models", {
      headers: { Authorization: `Bearer ${config.apiKey}` },
    });
    const data = await response.json();
    return data.models.map((m: any) => ({ id: m.id }));
  },
});

Wire it into a product

const myProduct = defineProduct({
  // ...
  capabilities: {
    tools: [/* ... */],
    runtimes: { llm: llmCapability },
  },
});

Vendors providing LLM capabilities also set the top-level llm field for the platform's model picker:

export default defineVendor({
  // ...
  llm: {
    defaultModel: "my-model-v1",
    models: [
      {
        id: "my-model-v1",
        pricing: { input: 3.0, output: 15.0, updatedAt: "2026-01-15" },
        capabilities: { temperature: { min: 0, max: 2 } },
        contextWindow: 128000,
      },
    ],
  },
});

Benchmarks

BenchmarkDirection
MMLUhigher is better
HumanEvalhigher is better
GPQAhigher is better

Add benchmarks to your model entries and the UI displays them alongside model name, context window, and pricing.

On this page

On this page