Registry / llm-agents / npmai
library0.1.9pypypi✓ verified 84d ago

npmai is a lightweight Python package (current version 0.1.8) designed to bridge the gap between users and open-source LLMs. It allows connection with Ollama and over 10 other powerful models instantly, without requiring local installation, user logins, or API keys. It also facilitates the development of RAG Agents without local or cloud installations, offering free and unlimited usage. The project shows a consistent release cadence with minor version updates addressing features and bug fixes.

pip install npmai
INSTALL
IMPORT
SIG · NPMAI
N
npmai
llm-agentspythonv0.1.9
Install
2.1s avg
Import
580ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.609s · 21.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.1s · import 0.550s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Ollama
from npmai import Ollama
Memory
from npmai import Memory
Introduced in v0.1.3 for native memory support.
Rag
from npmai import Rag
Used for Retrieval-Augmented Generation (RAG) functionalities.

This quickstart demonstrates how to use `npmai` to interact with an open-source LLM (like llama3.2) without any local setup. It initializes the `Ollama` class, sends a prompt, and prints the generated response.

from npmai import Ollama # Initialize the Ollama model (llama3.2 is an example) llm = Ollama(model="llama3.2", temperature=0.5) # Define your prompt prompts = "Hello, tell me a short summary of NPMAI" # Invoke the LLM to get a response result = llm.invoke(prompts) # Print the result print(result)
Debug
Known issues
breakingParameters of the `Rag` class have been updated across minor versions (e.g., in v0.1.7) to support new functionalities like sending multiple file types and integrating with Supabase. Existing RAG agent implementations relying on previous parameter signatures may break.
fix
Review the latest documentation or `npmai`'s PyPI release notes for the `Rag` class's updated parameter list and adjust your code accordingly.
affects: >=0.1.7
gotchaWhile `npmai` advertises 'zero setup, no API keys, no installation' for LLM access and RAG, it internally relies on hosted cloud services (e.g., Huggingface Server for RAG processes, Supabase for vectorized document storage). Users should be aware of these external dependencies for reliability and potential production considerations.
fix
Understand that the 'zero setup' is achieved by abstracting external cloud services. For critical applications, investigate the stability and performance of the underlying services `npmai` uses. No direct code fix is required, but awareness is key.
affects: All versions
gotchaAs a library in its early development stage (v0.1.x), the API and class methods (e.g., `Memory` class methods like `clear_memory` added in v0.1.7) are subject to change in minor releases without explicit deprecation warnings or major version bumps. This can lead to unexpected behavior or breakage.
fix
It is highly recommended to pin exact versions of `npmai` in your `requirements.txt` (e.g., `npmai==0.1.8`) to prevent unexpected changes. Regularly review the PyPI release history or GitHub for updates when upgrading.
affects: All 0.1.x versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'npmai'
The 'npmai' package has not been installed in the Python environment where the code is being executed.
fix
Install the package using pip: `pip install npmai`
Connection refused
The remote LLM service (like Ollama or other models) that `npmai` attempts to connect to is either unreachable due to network issues, offline, or is actively refusing the connection.
fix
Ensure that your device has a stable internet connection and verify the operational status of the `npmai` remote services or the specific LLM endpoint you are trying to access. If you are interacting with a self-hosted Ollama instance (contrary to npmai's zero-setup philosophy), ensure it is running and accessible.
AttributeError: 'Ollama' object has no attribute 'some_method'
You are attempting to call a method or access an attribute that does not exist on the `npmai.Ollama` object, possibly due to a typo or a misunderstanding of the API.
fix
Consult the `npmai` documentation for the correct methods and attributes available on the `Ollama` class. For example, to send a prompt, use `llm.invoke(prompt)`.
Upgrade
Version history
0.1.9latest on PyPI · released May 16, 2026
Audit
Dependencies
requestsrequiredUsed for making HTTP requests to interact with external LLM services.
langchain-corerequiredProvides core abstractions for building LLM applications, integrating with existing AI frameworks.
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
npmai — pip install npmai · libregistry