Installation
Basic Chat Completion
Instantiate the client with Boole’sbaseURL and call chat.completions.create exactly as you would against the OpenAI API.
example.mjs
Streaming
Setstream: true and iterate over the response with for await. Boole begins returning tokens almost immediately at up to 312 tokens/sec on Llama 3.3 70B.
streaming.mjs
TypeScript
The OpenAI SDK ships with full TypeScript definitions. ImportChatCompletionMessageParam and other types directly from the openai/resources sub-path — no extra @types package needed.
example.ts
Local Deployment
When running the Boole local binary, changebaseURL to point at localhost. The local server does not validate API keys, so pass any non-empty string.
local.mjs
The local binary cold-starts in under 400 ms and exposes the same
/v1 interface as the cloud API. Toggle between environments by changing a single line — the rest of your application code is unchanged.