A lightweight Selenium-based LangChain-compatible multi-LLM bridge (Gemini, ChatGPT, Grok, Perplexity,Image_Model,GeminiAIMode) built by Sonu Kumar.
Project description
npmai
npmai (by Sonu Kumar Ramashish) is a lightweight Python package that seamlessly connects LangChain with real-time web-based LLMs like Gemini, ChatGPT, Grok, Mistral and Perplexity via Selenium automation.
🚀 Features
Execute prompts on multiple LLMs simultaneously: Gemini, ChatGPT, Grok, Perplexity, Mistral.
Fully LangChain-compatible interface.
Simple and intuitive invoke() API for instant responses.
Browser automation with headless Chrome via Selenium.
Supports continuous conversation mode for long-running interactions with ChatGPT or Gemini.
Encourages responsible usage—please respect AI companies like OpenAI, Google, X AI, Perplexity, Mistral and support them if used at scale.
⚙️ Installation pip install npmai
Tip: For Python 3.13, make sure to use:
py -3.13 -m pip install npmai
💡 How to Use
Import the models you need—either one, two, or all:
from npmai import ChatGPT, Grok, Perplexity, Gemini, GeminiAIMode,Image,Mistral
Initialize a model:
llm = ChatGPT() # or Gemini(), Grok(), Perplexity(),Image(),Mistral()
Invoke a prompt and get the response:
response = llm.invoke("Your prompt here") print(response)
#Latest Update : version 0.0.7 Here you will get Mistral also.
⚠️ Important Notes
Designed for educational and small-scale experimentation.
If using at a larger scale, consider supporting the original AI platforms—they invest heavily in research and infrastructure.
Continuous mode allows extended conversations, but use responsibly to avoid overloading web-based LLM services.
✅ npmai makes it effortless to connect web-based AI models with Python, bringing automation, experimentation, and LangChain integration together in a single, easy-to-use package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file npmai-0.0.7.tar.gz.
File metadata
- Download URL: npmai-0.0.7.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2b0623d9bf648a708add5af28d286b608831ba2437d9b80ac3eac5a67eca65c
|
|
| MD5 |
2f80d4865ea5caaf2e6a9f80afd19b20
|
|
| BLAKE2b-256 |
ec670665a154ac82cf201f3ccc32eb1245c22d7520dffd088f35ddf341e0e402
|
File details
Details for the file npmai-0.0.7-py3-none-any.whl.
File metadata
- Download URL: npmai-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c269d792e08d4973a0cd61ab2437bd91976f152e370b842f403a48a5553ca63
|
|
| MD5 |
afa89661428c12e61ee73437d69f66b6
|
|
| BLAKE2b-256 |
e7073fc153114faf77047e70ec05104c76f9a422022d2b5f0ab51f546284f2f8
|