Favicon of npcpy

npcpy

An open-source Python AI agent library supports local LLMs and cloud APIs, with multi-agent teams, knowledge graphs and structured output.

npcpy is a Python library for developers and researchers building AI agents and applications with language models. It supports local LLM backends as well as cloud providers, so projects can choose where model requests run.

  • Agents and teams: Give agents personas and directives, equip them with shell, Python and file-editing tools, or attach custom tools and MCP services; coordinate teams and run debates between agents.
  • Repeatable workflows: Build multi-step prompt pipelines, provide instructions on demand, and apply context and tool constraints in software rather than relying only on prompts.
  • Knowledge and memory: Build, update and search knowledge graphs from text, and extract, approve and backfill memories through a memory pipeline.
  • Media and training: Generate images, audio and video through supported backends such as diffusers, OpenAI, Gemini and ElevenLabs, with fine-tuning tools that include diffusion training and MLX on Apple Silicon.
  • Application integration: Stream responses, request structured JSON with Pydantic schemas, and expose agent teams through a Flask REST API.

npcpy runs on Linux, macOS and Windows and is open source under the MIT license. Local backends include Ollama, llama.cpp, omlx and LM Studio; it can also run QLLM-PAM checkpoints directly from local files. LiteLLM connects cloud providers including Anthropic and DeepSeek. Cloud model requests go to the selected external service.

Similar to npcpy