Skip to main content

Crate localbrain

Crate localbrain 

Source
Expand description

§localbrain

Rust client for a localbrain endpoint — free, private, local AI. It just makes HTTP calls to a local, OpenAI-compatible model, so it’s a featherweight dependency.

use localbrain::Client;

let ai = Client::new(); // reads LOCALBRAIN_URL, defaults to http://localhost:4141/v1

let reply = ai.chat("Say hi in five words").await?;
let label = ai.classify("the invoice is overdue", &["billing", "support", "sales"]).await?;
let vector = ai.embed("find me by meaning").await?;

To stand up the endpoint this talks to, run the CLI in your project once: npx localbrain.

Structs§

ChatOptions
Per-call options for Client::chat_with / Client::summarize_with.
Client
A client bound to a localbrain endpoint.
ClientBuilder
Builder for Client.
Health
Result of Client::health.

Enums§

Error
Errors returned by the client. Each maps to an actionable cause.

Type Aliases§

Result
Convenience result alias.