nanoPerplexityAI  by Yusuke710

Minimal LLM service implementation, like Perplexity AI

created 1 year ago
317 stars

Top 86.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a minimalist, open-source implementation of Perplexity.ai's core functionality, enabling users to query information and receive answers sourced from Google searches. It is designed for developers and researchers seeking a straightforward, code-centric approach to LLM-powered information retrieval without complex interfaces or agent systems.

How It Works

The system takes a user query, determines if a Google search is necessary, and reformulates the query for optimal search results. It then fetches relevant webpage content, constructs a prompt combining a system prompt, fetched context, and the user query, and sends it to an LLM API for streamed completion. The output is saved to a markdown file for visualization.

Quick Start & Requirements

  • Install: pip install googlesearch-python requests beautifulsoup4 lxml backoff openai
  • Requirements: OpenAI API key (set as OPENAI_API_KEY environment variable).
  • Run: python nanoPerplexityAI.py
  • Setup: Minimal, requires API key.
  • More Info: Video Explanation

Highlighted Details

  • Implemented in approximately 200 lines of Python.
  • Citations are derived from Google search results.
  • Real-time generation can be viewed by opening playground.md in VS Code.

Maintenance & Community

The project acknowledges inspirations from perplexity.ai, clarity-ai, and Perplexica. No specific community channels or active maintenance signals are detailed in the README.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The implementation does not reformat search results, meaning not all results are utilized, prioritizing speed and streaming. It lacks a GUI and LLM agents, focusing solely on the core retrieval and generation loop.

Health Check
Last commit

6 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
13 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.