Skip to main content

A lightweight Selenium-based LangChain-compatible multi-LLM bridge (Gemini, ChatGPT, Grok, Perplexity) built by Sonu Kumar Viral Boy.

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, and Perplexity via Selenium automation.

🚀 Features

Execute prompts on multiple LLMs simultaneously: Gemini, ChatGPT, Grok, Perplexity.

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, 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

Initialize a model:

llm = ChatGPT() # or Gemini(), Grok(), Perplexity()

Invoke a prompt and get the response:

response = llm.invoke("Your prompt here") print(response)

⚠️ 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


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.0.2.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.0.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: npmai-0.0.2.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.0.2.tar.gz
Algorithm Hash digest
SHA256 453915cb5d95aacf3ccd0c4184cb115c21b74610781fc20050286ab87a42f1b1
MD5 1f0e3e1a6c7a1896300de7e32bcd0c25
BLAKE2b-256 92573261ac765cfa8714a161ca8d87f5f0e8a0bb4d932058fb7c390b565f529a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: npmai-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 677ba65f2ea0686954b20b4fcf8da6e8380b1b3fe67c038420e067e8f1a50d94
MD5 6ea3ab1f45d68950f04513161e4d96ba
BLAKE2b-256 b4012cff02125a6537221b054e4977fc94ed40246bbb8156dfa9b28342901ad5

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