open source · apache 2.0 · python · local-first

Run AI workflows locally.

Ready-made AI tasks and workflows. Local runtimes — Llama.cpp and HuggingFace Transformers. No data leaves the box.

$pip install aibackends
pypi ↗see the code
aibackends · RedactPIITask(transcript) · backend=gliner · runtime=local
STEP 01
ingest
read transcript · detect language
STEP 02
detect
local NER · GLiNER backend
STEP 03
classify
label entities · score confidence
STEP 04
redact
replace spans · keep entity map
STEP 05
validate
pydantic schema · RedactedText
running locally · step 01 of 05 · GLiNER on-device

input · transcript.txt

Hi, this is Sarah Chen calling from Acme Health. You can reach me at sarah.chen@acmehealth.com or on +65 9123 4567. Patient ID is PT-008341.

output · RedactedText

  # local NER running …
§ 01 · the shape of the code

The pipeline above. In code.

One import. One task. Local NER, typed output, zero egress. Override the backend or labels per call.

from aibackends.tasks import RedactPIITask, create_task

task = create_task(
    RedactPIITask,
    backend="gliner",
    labels=[
        "name",
        "email",
        "phone_number",
    ],
)
note_path = Path(__file__).parent.parent / "data" / "contract.txt"
result = task.run(note_path)
§ 02 · why aibackends

Four reasons. Local first.

Run AI workloads on your own hardware. Get typed outputs. Compose tasks into workflows. Add orchestration only when you need it. The rest is detail.

§ 01

Local-first by design

First-class Llama.cpp and HuggingFace Transformers runtimes. Same typed APIs, in-process. No data leaves the box.

§ 02

Typed outputs

Every structured task returns a Pydantic model. No string parsing, no surprises, predictable contracts.

§ 03

Composable tasks

Each task is a single function with a clear input and a typed output. Compose them, swap them, call them anywhere.

§ 04

Optional orchestration

Workflows add retries, steps, and batch execution — without forcing you onto a particular runner.

§ 03 · how it fits

One library. Many consumers.

Your apps, scripts, data pipelines, and batch jobs all call into the same tasks and workflows. Add new consumers without rewriting the underlying extraction, classification, or redaction logic.

Your code
Back-office appData pipelineNightly batch jobInternal APICLI toolsNotebook · script
aibackends
tasks
SummarizeTaskClassifyTaskEmbedTaskExtractTaskRedactPIITaskExtractInvoiceTaskSalesCallReportTaskVideoUnderstandingTask
workflows
InvoiceProcessorPIIRedactorSalesCallAnalyserVideoIntelligence
Runtime
llama-cpp-pythonllama-cpp-python · CUDAllama-cpp-python · Metaltransformers
Output
Pydantic modelsInvoiceOutputRedactedTextSalesCallReport
§ 04 · the task library

Real work, one import away.

Each task is one function. Input → typed Pydantic output. Pass straight to any agent, or call from a script.

TASK 01
● live

ExtractInvoiceTask

(pdf) → InvoiceOutput

PDF or image → typed invoice with vendor, line items, tax, due date, payment terms.

vision · [pdf]
TASK 02
● live

RedactPIITask

(text) → RedactedText

Local NER via gliner. Nothing leaves the box.

NER · [pii]
TASK 03
● live

SalesCallReportTask

(audio) → SalesCallReport

Transcribe, redact PII, extract talk ratio, objections, buying signals, score.

audio · [audio]
TASK 04
○ planned

VideoUnderstandingTask

(video) → VideoUnderstandingReport

Business meeting video → speaker diarisation, key decisions, action items, and talk-time ratio. Turn recorded calls into structured reports — archive to a knowledge base without leaving your infra.

video · meetings · [video]
TASK 05
● live

ClassifyTask

(text, labels) → Classification

Zero-shot text classification with confidence scores across all labels.

text · core
TASK 06
● live

ExtractTask

(text, schema) → YourModel

Pass any Pydantic schema. Get structured data back. Validation retries baked in.

text · core
TASK 07
● live

SummarizeTask

(text) → str

Short, faithful summaries. No hallucinated facts. Length controllable.

text · core
TASK 08
● live

EmbedTask

(text) → list[float]

Local sentence embeddings. minilm-l6, bge-small, or any sentence-transformers model.

embed · core
TASK 09
○ planned

ExtractMenu

(image) → Menu

Menu photo → items, prices, categories, allergens. SEA-ready (mixed languages).

vision · roadmap
AI integrations & consulting

Need help with AI in your stack?

Local infra with AIBackends, or commercial models — OpenAI, Gemini, and Claude. Reach out for a consultation.

Connect on LinkedIn ↗
get started

One import. Local models. Typed outputs.

$pip install aibackends
pypi ↗github ↗
Local runtimes
$pip install aibackends[llamacpp]
$pip install aibackends[llamacpp-cuda]
$pip install aibackends[llamacpp-metal]
$pip install aibackends[transformers]
Capability extras
$pip install aibackends[pdf]
$pip install aibackends[audio]
$pip install aibackends[video]
$pip install aibackends[pii]