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. 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. python 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 or local dev: python -m venv .venv && source .venv/bin/activate pip install -e ". dev,examples,openai,ollama,pgvector " docker compose up -d db 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 https://github.com/abadiape/llm-harness-lite/blob/main/LOCAL SETUP.md 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 https://github.com/abadiape/llm-harness-lite/blob/main/docs/configuration.md 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. python 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: python 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 — normalized chat 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 https://github.com/abadiape/llm-harness-lite/blob/main/docs/guide.md — start with one tool and grow the same agent in small steps - Choose an LLM and configure your app https://github.com/abadiape/llm-harness-lite/blob/main/docs/configuration.md — providers, credentials, optional YAML configuration, and per-model cost estimates - RAG and MCP integrations https://github.com/abadiape/llm-harness-lite/blob/main/docs/integrations.md — 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