AbstractCore
Unified LLM Interface
Write once, run everywhere
What's new in 2.39.0: on Windows, agents' shell commands run inside the command sandbox under every workspace setting ("Allow everything, refuse listed workspaces" read & write or read-only by default, and "Deny everything, allow listed workspaces"); a drive that stores no permissions (exFAT, FAT, a network share) is named in each command's result as not protected. In 2.38.0: the first Windows sandbox, for the read & write default. See the changelog.
What's new in 2.37.0: with stream=True, a native tool call arrives once and complete from OpenAI, OpenAI-compatible (vLLM, LM Studio, OpenRouter, Portkey) and Anthropic streams; a tool call the model did not finish (output stopped at its limit) is reported in metadata["unparsed_tool_call"] instead of being delivered with empty arguments, streamed or not; and the registry covers the Thinking Machines Inkling family (Inkling 2 Mini, Inkling 2 Small, Inkling, Inkling Small) with native tool calling. See the changelog.
What's new in 2.36.0: on an NVIDIA GPU the recommended text model follows the total GPU memory (Qwen3.8 27B from 22 GiB, across all GPUs); Qwen3 Embedding 0.6B joins the recommended starter set; a circuit-breaker refusal names the provider's last error and when the next attempt is made.
What's new in 2.35.1: a plain pip install "abstractcore[gpu]" on a Linux NVIDIA machine now runs GGUF models on the GPU (AbstractCore installs llama.cpp's CUDA build itself, once, the first time it is needed). In 2.35.0: the model capability registry covers the current vendor lineups (GPT-6 and GPT-6.1, Claude 5.5 and Fable 5.1, Grok 4.3 to 4.7, Qwen 3.8, DeepSeek V4.1 Flash, GLM 5.3, MiniMax M3.1 Flash, Kimi K3 and K3.1 Pro, LFM3, Spark X2.5/X2.6, Nemotron 3.5, Bonsai 2 and more), so an image, video or voice route can name them; and a GGUF or MLX re-packaging of a registered model (unsloth/...-GGUF:Q4_K_M, mlx-community/...-4bit, bartowski's Org_Model-GGUF) resolves to that model's entry instead of the text-only default. Transcriptions report language and detected_language. See the changelog.
What's new in 2.34.0: a local model that no call has used for 60 minutes is unloaded from memory and loads
again on its next call; a model kept loaded (Keep loaded) never is, and no running call is interrupted
(process_residency.set_idle_unload(seconds), 0 turns it off). A provider key you send to the server's discovery
routes now reaches only the provider you name, never every provider those routes check. The web console's themes
match ui-kit 0.9.14. See the changelog.
AbstractCore is an offline-capable, open-source-first LLM infrastructure layer
for Python applications. It gives you one create_llm(...) API across local
runtimes, self-hosted servers, cloud APIs, and OpenAI-compatible gateways.
Use it in-process from Python, or run it as a universal /v1 endpoint for apps
that already speak the OpenAI API. The same application can run fully offline
once local model assets are installed, stay private on your own inference
server, or route to hosted providers when you want managed capacity.
The goal is simple: put LLM capability at your fingertips without tying your
product to a vendor, network connection, or model family. AbstractCore keeps
application code portable while the model underneath moves between OpenAI,
Anthropic, Ollama, LM Studio, MLX, HuggingFace/GGUF, vLLM, OpenRouter, Portkey,
or any OpenAI-compatible backend.
The default install (pip install abstractcore) runs every remote provider with
no further setup; abstractcore[apple] and abstractcore[gpu] add the local
engines for Apple silicon and NVIDIA / AMD machines. For local runtimes, AbstractCore is
cache-first and offline-first: it will not silently download model weights; you
download the models you want (abstractcore models download ...), then run
without internet when your chosen provider and tools are local.
First-class support for:
- offline-capable local operation with explicit model setup (no silent downloads)
- local/open-weight model backends (Ollama, LM Studio, MLX, HuggingFace/GGUF, vLLM)
- cloud, hosted gateway, and generic OpenAI-compatible providers
- sync + async
- streaming + non-streaming
- universal tool calling (native + prompted tool syntax)
- structured output (Pydantic)
- unified generation parameters, capability detection, and provider quirks
- session memory, prompt caching, durable memory bloc cache artifacts, events, tracing, and retry-aware reliability hooks
- media input (images/audio/video + documents) with explicit, policy-driven fallbacks (*)
- optional capability plugins (
core.voice/core.audio/core.vision/core.music/core.scene3d/core.camera) for deterministic TTS/STT, generative vision, music, 3D generation, and real-camera piloting (via packages such as abstractvoice, abstractvision, abstractmusic, abstract3d, and abstractcamera)
- decision models (text in, calibrated typed decisions out):
generate(document, output="decision", questions=...) with one abstraction over hosted Jev (typesafe), any System One host (systemone), and local Kev / Lev / Laya checkpoints on MLX, transformers or GGUF; the server speaks the System One API (POST /v1/decisions); see Decision Models
- glyph visual-text compression for long documents (**)
- optional OpenAI-compatible
/v1 gateway server (multi-provider, including response_format
structured outputs validated against your schema) and single-model endpoint
(*) Media input is policy-driven (no silent semantic changes). If a model doesn’t support images, AbstractCore can use a configured vision model to generate short visual observations and inject them into your text-only request (vision fallback). Audio/video attachments are also policy-driven (audio_policy, video_policy) and may require capability plugins for fallbacks. See Media Handling and Centralized Config.
(**) Optional visual-text compression: render long text/PDFs into images and process them with a vision model to reduce token usage. See Glyph Visual-Text Compression (included in the light install).
Generative vision uses abstractvision when installed. In server mode, omit
model only when the server has a configured default, or use explicit
provider/model ids such as diffusers/default, diffusers/<huggingface-repo>,
mlx-gen/AbstractFramework/qwen-image-2512-4bit,
mlx-gen/AbstractFramework/wan2.2-t2v-a14b-diffusers-8bit, sdcpp/default, or
openai-compatible/<model>. Quantized MLX-Gen models are selected by their
published repo id; Core does not add a separate quant override.
Docs: Getting Started · FAQ · Docs Index · https://lpalbou.github.io/AbstractCore
For AI assistants and doc-indexing tools, this repository also publishes
llms.txt and llms-full.txt. MCP clients such as
Context7 can query the public documentation directly as well.
For AI agents
Register and use the abstractcore agent skill
to write integrations and operate the Python API, CLI and HTTP server. Start by reading
skills/abstractcore/SKILL.md;
keep its references/ folder alongside it when copying the skill into your agent's skill directory.
In a source checkout, tell another agent: Read skills/abstractcore/SKILL.md and use its
references for this task.
The skill covers provider and artifact selection, token/time/cost limits, host-controlled
tools, sessions, typed output, media and diagnostics. The canonical
integration and operations guide contains the same supported workflows;
source contributors should also read Contributing.
Why AbstractCore
Many libraries can call an LLM. AbstractCore is for the messy middle of real
applications, where you need the same product code to survive different model
families, local inference servers, API dialects, offline deployments, and
capability gaps.
Open-source and self-hosted models are first-class, not a demo path. AbstractCore
handles the things that often break when you move beyond a single hosted API:
prompted vs native tools, schema-following differences, structured-output retry,
reasoning text, media support, token budget vocabulary, local server discovery,
and prompt/cache behavior.
That makes it a practical foundation for privacy-sensitive assistants, local
developer tools, document workflows, research machines, edge deployments, and
cloud-backed production services. You can build remote-first products, fully
local products, or hybrid products that move between the two as cost, privacy,
latency, and hardware constraints change.
Use AbstractCore when you want a focused provider layer that stays close to your
application code. Use the wider AbstractFramework stack when you also need
durable runtime execution, agents, flows, gateways, agentic CLI surfaces, memory,
or assistant applications such as
AbstractAssistant.
AbstractFramework ecosystem
AbstractCore is part of the AbstractFramework ecosystem:
- AbstractFramework (umbrella): https://github.com/lpalbou/AbstractFramework
- AbstractCore (this package): provider-agnostic LLM I/O + reliability primitives
- AbstractRuntime: durable tool/effect execution, workflows, and state persistence (recommended host runtime) — https://github.com/lpalbou/abstractruntime
- Wider stack: agents, flows, gateway control, agentic CLI integrations, memory, semantics, coding tools, and digital assistant surfaces built on the same foundation
By default, AbstractCore is pass-through for tools (execute_tools=False): it returns structured tool calls in response.tool_calls, and your runtime decides whether/how to execute them (policy, sandboxing, retries, persistence). See Tool Calling and Architecture.
graph LR
APP["Your app"] --> AC["AbstractCore"]
AF["AbstractFramework optional"] --> AC
AF --> RT["AbstractRuntime / Agent / Flow / Gateway"]
AC --> P["Provider adapter"]
P --> LLM["LLM backend"]
AC -.->|tool calls| RT
RT -.->|tool results| AC
Install
Install in one line (no admin rights, no Python needed):
macOS / Linux:
curl -LsSf https://abstractframework.ai/core/install.sh | sh
Windows 10 / 11 (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://abstractframework.ai/core/install.ps1 | iex"
The script detects the machine (Apple Silicon with macOS 14+: abstractcore[apple]; an NVIDIA or
ROCm card: abstractcore[gpu]; anything else: the light install) and installs AbstractCore alone
with uv and Python 3.12, giving you the abstractcore, abstractcore-chat and
abstractcore-endpoint commands and the apps; run it again to upgrade. It never starts a compiler,
so echo cancellation and stable-diffusion.cpp are left out (Diffusers / MLX-Gen cover image
generation; with a C compiler you can add them yourself). Options and details:
One-line install.
With pip, in your own Python environment, AbstractCore has three install settings: