Attestation Batching Service (adapters/llm-api.ts)

clawdstrike · apps/terminal/src/dispatcher/adapters/llm-api.ts · typescript · Apache-2.0
ai, infra, payments, lang:rust, tag:batching

Collects and buffers checkpoint attestations for efficient on-chain submission. Use this to optimize transaction throughput in blockchain anchoring services.

// Source: https://github.com/backbay-labs/clawdstrike | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Shared LLM API call utilities for adapter modules.
 *
 * Eliminates duplication of Anthropic / OpenAI fetch logic across adapters
 * while allowing each adapter to customise model, system prompt, and error detail.
 */

import type { AdapterResult } from "../index"

export interface AnthropicCallOptions {
  apiKey: string
  model: string
  systemPrompt: string
  userContent: string
  signal: AbortSignal
  startTime: number
  maxTokens?: number
  includeErrorBody?: boolean
}

export interface OpenAiCallOptions {
  apiKey: string
  model: string
  systemPrompt: string
  userC

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key