AbstractCore Capabilities

This document clearly explains what AbstractCore can and cannot do, helping you understand when to use it and when to look elsewhere.

What AbstractCore IS

AbstractCore is production-ready LLM infrastructure. It provides a unified, reliable interface to language models with essential features built-in.

Core Philosophy

Infrastructure

Not application logic

Reliability

Over features

Simplicity

Over complexity

Provider Agnostic

Works everywhere

✅ What AbstractCore Does Exceptionally Well

1. Universal LLM Provider Interface

What it does: Provides identical APIs across all major LLM providers.

# Same code works with any provider
def ask_llm(provider_name, question):
    llm = create_llm(provider_name, model="default")
    return llm.generate(question)

# All of these work identically
ask_llm("openai", "What is Python?")
ask_llm("anthropic", "What is Python?")
ask_llm("ollama", "What is Python?")

Key benefit: Identical API across all providers eliminates provider-specific code.

2. Production-Grade Reliability

What it does: Handles failures gracefully with retry logic, circuit breakers, and comprehensive error handling.

  • Automatic retries with exponential backoff for rate limits and network errors
  • Circuit breakers prevent cascade failures when providers go down
  • Smart error classification - retries recoverable errors, fails fast on auth errors
  • Event system for monitoring and alerting

Key benefit: Includes error handling, retries, and monitoring required for production use.

3. Universal Tool Calling

What it does: Tools work consistently across ALL providers, even those without native tool support.

from abstractcore import create_llm, tool

@tool
def get_weather(city: str) -> str:
    """Get weather for a city."""
    return f"Weather in {city}: 72°F, sunny"

# Works with providers that have native tool support
openai_response = openai_llm.generate("Weather in Paris?", tools=[get_weather])

# Also works with providers that don't (via intelligent prompting)
ollama_response = ollama_llm.generate("Weather in Paris?", tools=[get_weather])

Key benefit: Works with providers that lack native tool support through intelligent prompting.

4. Centralized Configuration System

What it does: Single source of truth for all settings with clear priority hierarchy.

# One-time configuration
abstractcore --status
abstractcore --set-global-default ollama/llama3:8b
abstractcore --set-app-default summarizer openai gpt-4o-mini
abstractcore --set-api-key openai sk-your-key-here
abstractcore --download-vision-model

# Now use anywhere without repeating config
summarizer document.pdf  # Uses configured defaults
python -m abstractcore.utils.cli --prompt "Hello"  # Uses CLI default

Key benefit: Configuration hierarchy (Explicit > App-Specific > Global > Default) reduces repetitive parameter passing.

5. Deterministic Generation

What it does: Provides consistent, reproducible outputs across all providers using seed parameters.

# Deterministic outputs with seed + temperature=0
llm = create_llm("openai", model="gpt-3.5-turbo", seed=42, temperature=0.0)

# These will produce identical outputs
response1 = llm.generate("Write exactly 3 words about coding")
response2 = llm.generate("Write exactly 3 words about coding")
# response1.content == response2.content (identical outputs)

# Works across providers with same interface
ollama_llm = create_llm("ollama", model="llama3.2:3b", seed=42, temperature=0.0)
mlx_llm = create_llm("mlx", model="mlx-community/Qwen2.5-Coder-7B-Instruct-4bit", seed=42, temperature=0.0)

Provider Support:

  • Native SEED: OpenAI, Ollama, LMStudio, MLX, HuggingFace
  • ⚠️ Warning: Anthropic (doesn't support seed but issues warning; use temperature=0.0 for consistency)

Key benefit: Consistent seed parameter support enables reproducible outputs for testing and debugging.

6. Universal Media Handling System

What it does: Attach any file type (images, PDFs, Office docs, data) with simple @filename syntax or media=[] parameter.

# Python API - works across ALL providers
llm = create_llm("openai", model="gpt-4o")
response = llm.generate(
    "Compare the chart with the data and summarize the document",
    media=["chart.png", "data.csv", "report.pdf"]
)

# CLI - same simplicity
# python -m abstractcore.utils.cli --prompt "Analyze @report.pdf and @chart.png"

# Supported: Images (PNG, JPEG, GIF, WEBP, BMP, TIFF)
#            Documents (PDF, DOCX, XLSX, PPTX)
#            Data (CSV, TSV, TXT, MD, JSON)

Key benefit: Same code works across all providers with automatic format detection and processing.

6. Vision Capabilities with Intelligent Fallback

What it does: Image analysis across all providers with automatic resolution optimization. Text-only models can process images through transparent vision fallback.

# Works with vision-capable models
llm = create_llm("openai", model="gpt-4o")
response = llm.generate(
    "What's in this image?",
    media=["photo.jpg"]
)

# Also works with text-only models via vision fallback
text_llm = create_llm("lmstudio", model="qwen/qwen3-next-80b")  # No native vision
response = text_llm.generate(
    "Analyze this image",
    media=["complex_scene.jpg"]
)
# Transparent: vision model analyzes → text model processes description

Key benefit: Automatic image optimization and vision fallback enables image processing with text-only models.

7. Tool Call Tag Rewriting for Agentic CLI Compatibility

What it does: Automatically rewrites tool call tags to match different agentic CLI requirements in real-time.

# Rewrite tool calls for different CLIs
llm = create_llm("openai", model="gpt-4o-mini")

# For Codex CLI (Qwen3 format)
response = llm.generate("Weather in Paris?", tools=tools, tool_call_tags="qwen3")
# Output: <|tool_call|>{"name": "get_weather", "arguments": {"location": "Paris"}}

# For Crush CLI (LLaMA3 format)  
response = llm.generate("Weather in Paris?", tools=tools, tool_call_tags="llama3")
# Output: {"name": "get_weather", "arguments": {"location": "Paris"}}

# For Gemini CLI (XML format)
response = llm.generate("Weather in Paris?", tools=tools, tool_call_tags="xml")
# Output: {"name": "get_weather", "arguments": {"location": "Paris"}}

Key benefit: Compatible with existing agentic CLIs without code changes.

8. Structured Output with Automatic Retry

What it does: Gets typed Python objects from LLMs with automatic validation and retry on failures.

from pydantic import BaseModel

class Product(BaseModel):
    name: str
    price: float

# Automatically retries with error feedback if validation fails
product = llm.generate(
    "Extract: Gaming laptop for $1200",
    response_model=Product
)

Key benefit: Automatic validation and retry reduces manual error handling.

❌ What AbstractCore Does NOT Do

Understanding limitations is crucial for choosing the right tool.

1. RAG Pipelines (Use Specialized Tools)

What AbstractCore provides: Vector embeddings via EmbeddingManager

What it doesn't provide: Document chunking, vector databases, retrieval strategies

# AbstractCore gives you this
from abstractcore.embeddings import EmbeddingManager
embedder = EmbeddingManager()
similarity = embedder.compute_similarity("query", "document")

# You need to build this yourself
def rag_pipeline(query, documents):
    # 1. Chunk documents - YOU implement
    # 2. Store in vector DB - YOU implement
    # 3. Retrieve relevant chunks - YOU implement
    # 4. Construct prompt - YOU implement
    return llm.generate(prompt)

Better alternatives:

2. Complex Agent Workflows (Use Agent Frameworks)

What AbstractCore provides: Single LLM calls with tool execution

What it doesn't provide: Multi-step agent reasoning, planning, memory persistence

# AbstractCore is great for this
response = llm.generate("What's 2+2?", tools=[calculator_tool])

# AbstractCore is NOT for this
def complex_agent():
    # 1. Plan multi-step solution - NOT provided
    # 2. Execute steps with memory - NOT provided
    # 3. Reflect and re-plan - NOT provided
    # 4. Persist agent state - NOT provided
    pass

Better alternatives:

When to Choose AbstractCore

✅ Choose AbstractCore When You Need:

  1. Reliable LLM Infrastructure
    • Production-ready error handling and retry logic
    • Consistent interface across different providers
    • Built-in monitoring and observability
  2. Provider Flexibility
    • Easy switching between OpenAI, Anthropic, Ollama, etc.
    • Provider-agnostic code that runs anywhere
    • Local and cloud provider support
  3. Universal Tool Calling
    • Tools that work across ALL providers
    • Consistent tool execution regardless of native support
    • Event-driven tool control and monitoring
  4. Centralized Configuration
    • Single source of truth for all settings
    • Clear priority hierarchy (Explicit > App > Global > Default)
    • No repetitive parameter passing
  5. Universal Media Handling
    • Attach images, PDFs, Office docs, data files
    • Same API across all providers
    • Automatic processing and formatting
  6. Deterministic Generation
    • Reproducible outputs with seed parameters
    • Empirically verified across all providers
    • Essential for testing and debugging
  7. Vision Capabilities
    • Image analysis across all providers
    • Automatic resolution optimization
    • Vision fallback for text-only models

❌ Don't Choose AbstractCore When You Need:

  1. Full RAG Frameworks → Use LlamaIndex or LangChain
  2. Complex Agent Workflows → Use AbstractAgent or LangGraph
  3. Advanced Memory Systems → Use AbstractMemory or Mem0
  4. Prompt Template Management → Use Jinja2 or LangChain Prompts
  5. Model Training/Fine-tuning → Use Transformers or Axolotl
  6. Multi-Agent Systems → Use CrewAI or AutoGen

Related Documentation

Getting Started

5-minute quick start guide

Centralized Configuration

Global settings and defaults

Media Handling

Universal file attachment

Vision Capabilities

Image analysis with fallback

API Reference

Complete Python API documentation

Tool Calling

Universal tool system guide

Examples

Real-world usage examples