llm
Package to connect and trace LLM calls.
Usage
import { LLM } from "@empiricalrun/llm";
const llm = new LLM({
provider: "openai",
defaultModel: "gpt-4o",
});
const llmResponse = await llm.createChatCompletion({ ... });
Vision utilities
This package also contains utilities for vision, e.g. extract text (OCR).
import { extractText } from "@empiricalrun/llm/vision";
const data = await driver.saveScreenshot('dummy.png');
const instruction = "Extract number of ATOM tokens from the image. Return only the number.";
const text = await extractText(data.toString('base64'), instructions);