Installation
Basic Chat Completion
Create a client pointing at the Boole Cloud API and callchat.completions.create exactly as you would with OpenAI.
example.py
Streaming
Setstream=True to receive tokens as they are generated. Use the context-manager form to ensure the connection closes cleanly when you’re done reading.
streaming.py
Async Usage
UseAsyncOpenAI in async applications — FastAPI handlers, async pipelines, or any asyncio-based code. The interface is identical to the sync client; just await the call.
async_example.py
Local Deployment
When you’re running the Boole local binary, changebase_url to point at localhost and pass any non-empty string as the API key — the local server does not perform key validation.
local.py
The local binary starts in under 400 ms and exposes the same
/v1 interface as the cloud API. You can switch between local and cloud by changing one line — everything else in your code stays the same.