nanoPerplexityAI  by Yusuke710

Minimal LLM service implementation, like Perplexity AI

Created 1 year ago
317 stars

Top 85.2% 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

7 months ago

Responsiveness

1 day

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

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Anton Troynikov Anton Troynikov(Cofounder of Chroma), and
44 more.

llama_index by run-llama

0.3%
44k
Data framework for building LLM-powered agents
Created 2 years ago
Updated 19 hours ago
Feedback? Help us improve.