Skip to main content

A lightweight Ollama(no ollama installation needed) based LangChain-compatible LLM bridge ('LLaMA-3.2','CodeLLaMA-Instruct 7B','Gemma-2-Instruct 9B','Mistral 7B Instruct','Qwen-2.5-Coder 7B','Phi-3 Medium (8B)','Falcon 7B Instruct','Baichuan-2-7B','InternLM-Chat-7B','Vicuna 7B') built by Sonu Kumar.

Project description

🚀 npmai

By Sonu Kumar Ramashish

PyPI version License: MIT

npmai is a lightweight Python package designed to bridge the gap between users and open-source LLMs. Connect with Ollama and 10+ other powerful models instantly—no installation, no login, and no API keys required.


✨ Features

  • 🔗 Zero Setup: No local Ollama installation or complex API signups needed.
  • 🤖 Multi-Model Support: Execute prompts across 10+ open-source models simultaneously.
  • 🧠 Built-in Memory: (New in v0.1.2) Native memory support—no need for external Agentic frameworks.
  • 🕵️‍♂️🔍📑 RAG Frame-Work: no need to install Whisper or any model locally,no need to write code for the pdf,image,video,yt-video to text just use npmai
  • Framework Ready: Fully compatible with LangChain, CrewAI, and other orchestration tools.
  • 🛠️ Universal API: Access via Python, JavaScript, C++, Java, or C.

🖥️ Supported Models

Model Name Description
llama3.2 Meta's latest powerful small model
gemma-2-instruct-9b Google's high-performance open model
qwen-2.5-coder-7b Alibaba's elite coding assistant
mistral-7b-instruct Versatile and efficient instructor model
phi-3-medium Microsoft's highly capable reasoning model
And many more... Falcon, Baichuan-2, InternLM, Vicuna

⚙️ Installation

Install via pip in seconds:

pip install npmai
Use code with caution.

Tip for Python 3.13+: Use py -3.13 -m pip install npmai
💡 Quick Start (Python)
python
from npmai import Ollama

# Initialize the LLM
llm = Ollama()      

# Simple invocation
response = llm.invoke("What is the future of AI?", model="llama3.2")
print(response) 

🌐 API Usage (Other Languages)
If you aren't using Python, hit our global endpoint:
POST https://npmai-api.onrender.com
🟡 JavaScript
javascript
const response = await fetch("https://npmai-api.onrender.com", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    prompt: "Hello! Who are you?",
    model: "llama3.2",
    temperature: 0.4
  })
});
const data = await response.json();
console.log(data.response);

🔵 C++
cpp
nlohmann::json payload = {
    {"prompt", "Explain quantum physics."},
    {"model", "llama3.2"},
    {"temperature", 0.4}
};
auto res = cli.Post("/llm", payload.dump(), "application/json");

🆕 Latest Update: Version 0.1.4
Now you do not need to write code for RAG tools like pdf,image,video,audio,yt-video to text and no need to load whisper and other requirements locally no local process everything on cloud in free without any signup or singin or key hurdles.
⚠️ Important Notes
Experimental Use: This project is designed for educational purposes, small-scale experimentation, and demo projects.
Scale Responsibly: For high-volume production traffic, please support the original AI researchers and infrastructure providers.
🔗 Resources
Documentation: npmai.onrender.com
API Endpoint: npmai-api.onrender.com/llm
Developed with ❤️ to make AI accessible to everyone.
Developer and Maintainer:- Sonu Kumar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npmai-0.1.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

npmai-0.1.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file npmai-0.1.4.tar.gz.

File metadata

  • Download URL: npmai-0.1.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for npmai-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9f8cae09dbfbecfbe5eed1155bc0ccc7010d91b1b727f5c83eeae4f0cf8c5050
MD5 1eac26e29f7e7278afabbd8d319a5b80
BLAKE2b-256 6f375f5befb743a34ca375b89071e4e7052ace24cd44d024ae4e1610f39304b2

See more details on using hashes here.

File details

Details for the file npmai-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: npmai-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for npmai-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 191f4aae50282be59a67dc857c5cdda6d20617c47f7ad638789cf78cae047197
MD5 64c35540cf0e9127b3e067d204ebbb06
BLAKE2b-256 8cd3d58edd6e832d6e2a890d76b5f417b38b7b3483e05465985310f71837adc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page