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 npmaiVerified import paths — ran on the pinned version, not inferred.
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.
Review the latest documentation or `npmai`'s PyPI release notes for the `Rag` class's updated parameter list and adjust your code accordingly.
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.
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.
Install the package using pip: `pip install npmai`
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.
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)`.