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(),GeminiAIMode()

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.4.tar.gz (4.2 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.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: npmai-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 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.4.tar.gz
Algorithm Hash digest
SHA256 c933e91ded0adb543572b31df13b4ae6dfcda47107162aa7044158717199b88b
MD5 b45e7a00799d7a19207800f12187856e
BLAKE2b-256 13919086a725365d612e0f9e6c881b316c11c529ebd2354d04cfe76a97f12baa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: npmai-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 20f382ae5c9b77d39c37fed66df6cd8166bd1d264e350336fc08d5fc592217c9
MD5 4d1e8375c4a712f6d84d5a9f91cf80d7
BLAKE2b-256 5649be7350e4914c1f5ab8fa7ee862fac2c8039ee88694c312844152b13a011f

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