抽象核心 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
抽象核心 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
抽象核心 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install abstractcore
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install abstractcore
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/lpalbou/AbstractCore
cd AbstractCore
pip install -e .
# 验证安装
python -c "import abstractcore; print('安装成功')"
# 命令行使用
abstractcore --help
# 基本用法
abstractcore input_file -o output_file
# Python 代码中调用
import abstractcore
# 示例
result = abstractcore.process("input")
print(result)
# abstractcore 配置文件示例(config.yml) app: name: "abstractcore" debug: false log_level: "INFO" # 运行时指定配置文件 abstractcore --config config.yml # 或通过环境变量配置 export ABSTRACTCORE_API_KEY="your-key" export ABSTRACTCORE_OUTPUT_DIR="./output"
Unified LLM Interface > Write once, run everywhere
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 is intentionally lightweight; add providers and optional subsystems via explicit install extras. For local runtimes, AbstractCore is cache-first and offline-first: it will not silently download model weights; you pull or prefetch the models you want, 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) for deterministic TTS/STT, generative vision, and music backends (via packages such as abstractvoice, abstractvision, and abstractmusic) - glyph visual-text compression for long documents (*) - optional OpenAI-compatible /v1 gateway server (multi-provider) 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 (install pip install "abstractcore[compression]"; for PDFs also install pip install "abstractcore[media]").
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.
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.
AbstractCore is part of the AbstractFramework ecosystem:
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.
image = llm.generate("A red ceramic mug on a white table.", output="image") png_bytes = image.outputs["image"][0].data
speech = llm.generate(text="Hello from AbstractCore.", output="voice") wav_bytes = speech.outputs["voice"][0].data
music = llm.generate( text="A short calm piano loop.", output={"modality": "music", "provider": "acemusic", "duration_s": 8, "format": "wav"}, ) music_wav = music.outputs["music"][0].data
clone = llm.generate(text="Optional transcript.", media="reference.wav", output="voice") voice_id = clone.resources["voice"][0].resource_id
Text-only `generate(...)` is unchanged. For advanced/provider-specific work,
the direct `llm.vision.*`, `llm.voice.*`, `llm.audio.*`, and `llm.music.*` facades remain
available. Configure `abstractvision` and `abstractvoice` backends first for
real generation; configure `abstractmusic` for music generation. With
`abstractmusic>=0.1.13`, the default music backend is the lightweight remote
ACE Music path; set `ACEMUSIC_API_KEY` before use. Local music engines remain
optional plugin extras.
Catalog helpers are available for UI/dropdown preflight:
python image_models = llm.vision.list_provider_models(task="text_to_image") voices = llm.voice.voice_catalog() tts_models = llm.voice.list_tts_models() stt_models = llm.voice.list_stt_models() music_models = llm.capabilities.list_models("music", task="text_to_music") ```
The HTTP server exposes equivalent discovery at /v1/vision/providers/, /v1/vision/models, /v1/audio/voices, /v1/audio/speech/models, /v1/audio/transcriptions/models, and /v1/voice/clone/providers, plus /v1/audio/music/providers and /v1/audio/music/models. Generated media HTTP routes include /v1/images/generations, /v1/images/edits, /v1/videos/generations, /v1/videos/edits, and async polling routes under /v1/vision/jobs/images/* and /v1/vision/jobs/videos/*; image and video jobs include the latest backend progress event when the selected backend reports it. /v1/models remains focused on LLM and embedding provider models. Use capability_route to filter those models by precise route-keyed support: /v1/models?capability_route=input.image,output.text, /v1/models?capability_route=input.sound,output.text, /v1/models?capability_route=input.music,output.text, or /v1/models?capability_route=embedding.text. Generated-media provider readiness and download/setup status remain on the capability plugin catalog routes, not in /v1/models.
Choose the smallest install that matches where your models run. Extras compose, so you can start with abstractcore[remote] and add media, tools, server, or local runtime extras as your app grows.
```bash
pip install "abstractcore[all-apple]" # Apple Silicon: remote SDKs + HF/GGUF + MLX + features + server pip install "abstractcore[all-gpu]" # GPU host: remote SDKs + HF/GGUF + vLLM + features + server ```
apple/gpu are hardware-profile aliases for the local LLM engine stack. voice, audio, vision, and music install the lightweight capability plugin paths used for remote-capable routing. all-apple/all-gpu are larger aggregate profiles for a full local-development environment, including local plugin engines such as OmniVoice where supported.
Local/offline example (requires Ollama running with ollama pull qwen3:4b already done):
from abstractcore import create_llm
llm = create_llm("ollama", model="qwen3:4b")
response = llm.generate("Draft a privacy-preserving onboarding checklist.")
print(response.content)
Remote API example (requires pip install "abstractcore[openai]"):
from abstractcore import create_llm
llm = create_llm("openai", model="gpt-4o-mini")
response = llm.generate("What is the capital of France?")
print(response.content)
pip install "abstractcore[tools]" # built-in web tools (web_search, skim_websearch, skim_url, fetch_url) pip install "abstractcore[media]" # images, PDFs, Office docs pip install "abstractcore[voice]" # abstractvoice plugin (remote-light TTS/STT capability) pip install "abstractcore[vision]" # abstractvision plugin (generative vision capability) pip install "abstractcore[music]" # abstractmusic plugin (text-to-music capability) pip install "abstractcore[compression]" # glyph visual-text compression (Pillow-only) pip install "abstractcore[embeddings]" # EmbeddingManager + local embedding models pip install "abstractcore[tokens]" # precise token counting (tiktoken) pip install "abstractcore[server]" # OpenAI-compatible HTTP gateway
edited = llm.generate( "Make the mug blue using the second image as a style reference.", media=[ {"type": "image", "path": "mug.png", "role": "source"}, {"type": "image", "path": "style.png", "role": "style"}, ], output="image", )
def progress(event): print("media progress", event)
Interactive chat:
abstractcore-chat --provider openai --model gpt-4o-mini
abstractcore-chat --provider lmstudio --model qwen/qwen3-4b-2507 --base-url http://localhost:1234/v1
abstractcore-chat --provider openrouter --model openai/gpt-4o-mini
Token limits: - startup: abstractcore-chat --max-tokens 8192 --max-output-tokens 1024 ... - in-REPL: /max-tokens 8192 and /max-output-tokens 1024
pip install abstractcore
pip install "abstractcore[remote]"
pip install "abstractcore[openai]" # OpenAI SDK pip install "abstractcore[anthropic]" # Anthropic SDK pip install "abstractcore[huggingface]" # Transformers / torch (heavy) pip install "abstractcore[apple]" # Apple Silicon local LLM stack (alias of mlx; heavy) pip install "abstractcore[gpu]" # GPU local LLM stack (alias of vllm; heavy) pip install "abstractcore[mlx]" # Explicit MLX provider extra pip install "abstractcore[vllm]" # Explicit vLLM provider extra
AbstractCore also ships with ready-to-use CLI apps: - summarizer, extractor, judge, intent, deepsearch (see docs/apps/)
video = llm.generate( "A red fox walking through a snowy forest, cinematic.", on_progress=progress, output={ "modality": "video", "task": "text_to_video", "provider": "mlx-gen", "model": "AbstractFramework/wan2.2-t2v-a14b-diffusers-8bit", "width": 432, "height": 240, "num_frames": 41, "fps": 24, "steps": 20, "guidance_scale": 4.0, "guidance_2": 3.0, "extra": {"max_sequence_length": 256}, }, ) mp4_bytes = video.outputs["video"][0].data
高质量开源AI工作流项目,值得关注
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,抽象核心 在Agent工作流赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | AbstractCore |
| 原始描述 | 开源AI工作流:Code once, run everywhere across Ollama, LM Studio, MLX, HuggingFace, vLLM, Open。⭐7 · Python |
| Topics | 抽象层工作流AI |
| GitHub | https://github.com/lpalbou/AbstractCore |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-07 · 更新时间:2026-06-08 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端