npcpy
The python library for research and development in NLP, multimodal LLMs, Agents, ML, Knowledge Graphs, and more.
npcpy
A Python library providing primitives for research and development with multimodal language models, agentic AI and knowledge graphs, supporting local and cloud providers.
What it provides
npcpy is a library that provides key primitives for research and development with multimodal language models, agentic AI and knowledge graphs. Its flexible framework makes it easy to engineer AI applications with support for local providers such as ollama, llama.cpp, omlx and LM Studio, and cloud providers. The README says it builds multi agent teams and simplifies context engineering through an NPC Context-Agent-Tool data layer that ensures compliance through software rather than prompts.
Personas and agents
The library lets users create NPC personas with a name, a primary directive, a model and a provider, then call them directly, or use an Agent class that comes with default tools including sh, python, edit_file and web_search. Example agents can find all Python files over a certain number of lines in a repository or operate on files, and runs can be scoped with a budget. The README shows persona responses from models like qwen and gemma to illustrate the local provider path.
Distribution and license
npcpy installs via pip and is documented on Read the Docs, with a badge linking an MCP toplist entry. The project is licensed MIT. The framing is that it reduces the repeated scaffolding every LLM script grows, such as retries, caching, cost caps, rate limits, tool dispatch and conversation state, by making that scaffolding part of the runtime rather than something the user rewrites each time.
Editorial conclusion
npcpy is MIT licensed and reported one thousand four hundred sixty eight stars at indexing, with a playground style README showing persona, direct call and agent with tools examples.
Community notes