GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Yusuke710/nanoPerplexityAI: The simplest open-source implementation of perplexity.ai

BranchesTags
Open more actions menu

Latest commit

 

History

25 Commits
25 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
example_outputs
example_outputs
 
 
experiments
experiments
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
nanoPerplexityAI.py
nanoPerplexityAI.py
 
 
playground.md
playground.md
 
 

Repository files navigation

nanoPerplexityAI

The simplest and most intuitive open-source implementation of an open source perplexity.ai, a large language model(LLM) service which cites information from Google. No fancy GUI or LLM agents are involved, just 200 lines of python code. Please check out this video for more explanations!

Check out the conversations nanoPerplexityAI has generated

overview

Architecture

  1. Get the user query
  2. LLM checks the user query, decides whether to execute a Google search, and if searching, reformulates the user query into a Google-suited query to find relevant webpage URLs and fetch texts. (In practice, PerplexityAI searches its already indexed sources)
  3. Build a prompt using system prompt + webpage context + user query
  4. Call the LLM API to generate an answer
  5. As LLM perform stream completion, save the LLM response into a markdown file for better visualization.

#PerplexityAI does not reformat the search results and therefore not all search results are used and cited in the LLM response. This is because they prioritize displaying search results quickly and streaming LLM completion for a better user experience.

Install

pip install googlesearch-python requests beautifulsoup4 lxml backoff openai 

Quick Start

export OPENAI_API_KEY=<Your OpenAI API KEY>
python nanoPerplexityAI.py

The script will prompt you to type your question, then it will generate an answer in playground.md You can type a key s for [s]ave and q for [q]uit

View Real Time Generation

You can utilise Visual Studio Code to replicate the simpler version of PerplexityAI GUI. Open Preview of playground.md as you run python nanoPerplexityAI.py and you will see the real time generation!

DEMO

Gid

Other ways involve opening in Markdown Playground or pushing the output markdown files to your github repo for displaying markdown

Acknowledgements

Thank you perplexity.ai for the amazing idea and clarity-ai and Perplexica for coding inspirations on the open-source implementation of perplexity.ai.

About

The simplest open-source implementation of perplexity.ai

youtu.be/8zBDTnSYSoc?si=WVepg1koE2APzUCu

Topics

ai-search-enginelarge-language-modelsnanoperplexityaiopen-source-perplexity-aiperplexity-aisearch-enginesearchgpt

Resources

Readme
MIT license
Activity

Stars

338 stars

Watchers

6 watching

Forks

33 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.