Skip to main content

A lightweight Selenium-based LangChain-compatible multi-LLM bridge (Gemini, ChatGPT, Grok, Perplexity) 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, 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.3.tar.gz (4.1 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.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: npmai-0.0.3.tar.gz
  • Upload date:
  • Size: 4.1 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.3.tar.gz
Algorithm Hash digest
SHA256 5ea0e0280a0d1decd6ca9ead435f06f45c205ae8e0f609e87d6b933ae558e9ba
MD5 9382c8d8d65587ccfdfa61625065c3cc
BLAKE2b-256 892648cf2256a44cdb241a5ada1370e25d4385d84445f575968d1fbbcc07c714

See more details on using hashes here.

File details

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

File metadata

  • Download URL: npmai-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 891db4ec407b377b84eaf63d127282e63f076b74cc6dbcdefddd653886b18272
MD5 1e3c3a5630f91b413f60e40f50bb7645
BLAKE2b-256 3e8c406d596332636b12f403c10dafc00f9f66d0cecf0e9aa00b4cd6bca538f6

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