cd /news/ai-agents/vendor-neutral-llm-harness-with-loca… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-175594] src=github.com β†— pub= topic=ai-agents verified=true sentiment=↑ positive

Vendor-neutral LLM harness with local-first support

A new open-source Python library, llm-harness-lite 0.1.0, has been released as a vendor-neutral, local-first LLM agent harness whose core is roughly 1,000 lines of code and depends only on the Python standard library. The library routes config.yaml through an llm/factory, agent/loop and tools/registry pipeline, supports OpenAI-compatible providers including Ollama and vLLM plus Anthropic, and ships optional extras for pgvector and Qdrant retrieval and an MCP client, requiring Python 3.10 or newer. The release's author states the project is a library rather than a production API service or deployment stack, providing no application authentication, TLS configuration, high availability, backups or centralized monitoring, and asks users to file issues on rough edges in the async loop, MCP lifecycle, routing/cache semantics and API ergonomics.

key takeaway

llm-harness-lite 0.1.0 ships a standard-library-only core of about 1,000 lines with optional extras (openai, anthropic, pgvector, qdrant, mcp) so developers install only the provider and vector-store integrations they use, on Python 3.10 or newer.

read6 min views2 publishedNov 24, 2026
Vendor-neutral LLM harness with local-first support
Image: Michielbdejong (auto-discovered)

Local-first, vendor-neutral, cost-aware. Not the next LangChain: ~1k LOC core you can read in an afternoon.

config.yaml β†’ llm/factory β†’ agent/loop β†’ tools/registry (+ RAG as tool, MCP tools)

0.1.0 Feedback Welcome: This is an early release focused on clean primitives, explicit routing, and readable internals rather than heavyweight abstractions. If you spot rough edges in the async loop, MCP lifecycle, routing/cache semantics, or API ergonomics, please open an issue or start a thread in Discussions.

import asyncio
from llm_harness_lite import Agent, ToolRegistry, create_llm, tool

registry = ToolRegistry()

@tool(registry)
def add_numbers(a: int, b: int) -> int:
    """Add two integers together."""
    return a + b

async def main() -> None:
    llm = create_llm("openai_compat", "qwen3:8b", base_url="http://localhost:11434/v1")
    async with llm:
        agent = Agent(llm=llm, registry=registry)
        result = await agent.arun("What is 17 + 25?")
        print(result.answer, result.stop_reason, result.usage)

asyncio.run(main())

See examples/ (01_basic_chat.py through 07_document_inquirer.py) and LOCAL_SETUP.md for full workflows covering RAG, MCP, caching, and cost comparisons.

pip install llm-harness-lite                 # dependency-free core
pip install "llm-harness-lite[openai]"       # OpenAI-compatible providers
pip install "llm-harness-lite[anthropic]"    # Anthropic
pip install "llm-harness-lite[pgvector]"     # PostgreSQL + pgvector RAG
pip install "llm-harness-lite[qdrant]"       # Qdrant RAG
pip install "llm-harness-lite[mcp]"          # MCP client
pip install "llm-harness-lite[full]"         # all integrations + example config deps

The core package uses only the Python standard library. Provider SDKs, vector database clients, and the MCP SDK are optional; install only the extras your application uses. OpenAI-compatible providers (including Ollama and vLLM) use the openai extra.

The package requires Python 3.10 or newer. For local development, use a virtual environment and the optional extras for the providers and integrations you choose. Local setup uses Compose services bound to loopback; their sample credentials and unauthenticated Qdrant service are for local testing only.

This project is a library, not a production API service or deployment stack. It does not provide application authentication, network/TLS configuration, high availability, backups, or centralized monitoring. A production application must supply those and deploy its database/vector store with appropriate access controls. The Qdrant adapter can target such a deployment; the bundled Compose service is not one.

There is no universal CPU or memory minimum: hosted models require network access and provider credentials, while local Ollama requirements depend on the chosen model and context size. Size production resources for the model, workload, and expected concurrency.

The initial supported vector stores are intentionally limited to pgvector and Qdrant. The default local setup uses pgvector; the Qdrant adapter can connect to a secured production deployment. Both implement the same VectorStore contract and plug into the same Retriever. Embedding generation is separate from both storage and chat-model choice, so users own their vectors and can change LLM providers without binding retrieval to a model vendor.

Call store.init() before ingesting. Re-ingesting a source updates its source/chunk records instead of creating duplicates; direct store records with no ID use a stable content-and-metadata key. Both adapters validate vector dimensions and finite numeric values on writes and searches. Initializing an existing pgvector table adds the key column and a unique index without removing existing rows.

Run docker compose up -d qdrant only when testing the Qdrant path. The Qdrant client is available through the qdrant extra.

Built-in backends estimate USD cost from reported input and output token usage. Supply per-model rates when you want to account for custom or local model pricing; those overrides take precedence over catalog and fallback prices. See per-model cost estimates for the configuration and calculation example.

LLMRouter dispatches through a caller-supplied policy; it does not silently infer cost or quality tiers. The policy receives messages, tools, temperature, and named candidate routes, then returns one configured route. Keep the policy deterministic for equivalent requests when wrapping the router with CachedLLM. Exact cache keys include model, full messages, tool schemas, and temperature. Semantic cache matches are additionally scoped to model, temperature, and embedding model, and compare the full message context.

from llm_harness_lite import LLMRouter

def policy(request):
    return "tool-capable" if request.tools else "local"

llm = LLMRouter({"local": local_llm, "tool-capable": remote_llm}, policy)

Custom providers can implement the LLMBackend protocol and register a factory without changing the library:

import llm_harness_lite

llm_harness_lite.register_provider("my-runtime", MyBackend)
llm = llm_harness_lite.create_llm("my-runtime", "model-name", endpoint="http://localhost")
python
import llm_harness_lite

llm = llm_harness_lite.create_llm(
    "openai_compat", "qwen3:8b", base_url="http://localhost:11434/v1"
)

The agent API is async-first: use await agent.arun(goal) in async applications. agent.run(goal) is a synchronous convenience for scripts and must not be called from an already-running event loop. Agent results expose a structured stop_reason and usage totals. Tools can raise llm_harness_lite.ToolExecutionError for recoverable failures to return to the model; unexpected tool exceptions propagate to the caller.

Pass observer=callback to Agent for structured AgentEvent lifecycle metadata, including run IDs, model/tool timings, usage, and stop reason. Events omit prompts, tool arguments, and tool results. The synchronous callback runs inline and its errors propagate, so keep it fast and handle telemetry failures in the callback if they should not abort a run. Provider responses are checked for valid token counts, costs, and latency before budget accounting.

Built-in backends provide native achat() and aclose() methods; configure their request deadline with create_llm(..., timeout=60). In async applications, use async with backend to close provider resources. MCPClient follows the same async-context-manager pattern, and await mcp.register_into(registry) preserves remote tool schemas for use by Agent.arun(). Synchronous custom backends and tools run in worker threads; cancelling their await does not forcibly stop the underlying synchronous function. Implement achat() or an async tool for cancellable I/O.

See LOCAL_SETUP.md + examples/:

  • 01_basic_chat.py β€” normalizedchat() across providers

  • 02_agent_with_tools.py β€” minimal agent loop with a registered tool

  • 03_rag_ingest_search.py β€” compact pgvector ingest/search example

  • 04_cost_compare.py β€” bang-for-buck across models

  • 05_qdrant_mcp_cache.py β€” Qdrant + persistent MCP + semantic cache

  • 06_large_files_scanner.py β€” expanded tool example: interactive local scan and confirmed deletion

  • 07_document_inquirer.py β€” expanded RAG example: interactive Q&A over text files or PDFs

  • Build a purpose-specific agent β€” start with one tool and grow the same agent in small steps

  • Choose an LLM and configure your app β€” providers, credentials, optional YAML configuration, and per-model cost estimates

  • RAG and MCP integrations β€” add retrieval, remote tools, caching, and other optional capabilities

CI runs the test suite and lint on Python 3.10 and 3.15, then separately builds and installs the dependency-free wheel. The PyPI release workflow waits for CI.

  • src/llm_harness_lite/llm/ β€”types.py ,base.py (Protocol),openai_compat.py ,anthropic_backend.py ,factory.py
  • src/llm_harness_lite/agent/loop.py β€” framework-agnostic ReAct loop
  • src/llm_harness_lite/tools/registry.py β€”@tool + JSON Schema from signature
  • src/llm_harness_lite/rag/ β€”chunker.py ,embedder.py ,store_base.py ,store_pgvector.py ,store_qdrant.py ,retriever.py
  • src/llm_harness_lite/mcp/client.py β€”MCPClient +PersistentMCP background-loop bridge
  • src/llm_harness_lite/utils/ β€”costs.py ,cache.py (exact + semantic)
── more in #ai-agents 4 stories Β· sorted by recency
── more on @llm-harness-lite 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/vendor-neutral-llm-h…] indexed:0 read:6min 2026-11-24 Β· β€”