MIT License

项目介绍

philfung/perplexed 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 148 个 Star、19 次 Fork。

仓库全名
philfung/perplexed
开源许可证
MIT License
Star 数
148
Fork 数
19

README 摘要

Perplexed An open-source app inspired by the amazing web search product, Perplexity. Live Demo Implementation Given a user query, the app conducts a web search, downloads the top N resulting web pages, then analyzes those pages with an LLM. The LLM can be any smaller, consumer-grade with at least 5k context window (assuming each web page 1k tokens). Development To take advantage of the configured build steps, our…

完整内容见 GitHub 原始 README 或本页 。

常见问题

perplexed 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 148 个 Star。

perplexed 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 perplexed 的源码?

可以直接克隆仓库:git clone https://github.com/philfung/perplexed.git,默认分支为 main;安装与运行步骤见仓库 README。

perplexed 最近还在维护吗?

仓库最近一次更新为 2025年11月19日,当前没有未关闭的 Issue;Star 数为 148,可作为社区活跃度的参考。

关于

Open-source Perplexity app.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
187
价值分
94
活跃状态
活跃

README

Perplexed

An open-source app inspired by the amazing web search product, Perplexity.

Live Demo License: MIT Last Commit

Live Demo

Screenshot 2025-03-19 at 1 26 54 PM Screenshot 2025-03-19 at 1 26 35 PM

Implementation

Given a user query, the app conducts a web search, downloads the top N resulting web pages, then analyzes those pages with an LLM.

Screenshot 2024-11-16 at 10 06 03 AM

The LLM can be any smaller, consumer-grade with at least 5k context window (assuming each web page ~1k tokens).

Development

To take advantage of the configured build steps, our recommended tools are:

Workflow and Local Deployment

  • run just in the terminal to see available recipes. We support recipes to launch the app in dev, staging and production modes.
    • dev: run app as two processes on localhost
      • both processes can be exited with Ctrl-C in the terminal
    • staging: run app inside a docker container as a single http service, fronted by nginx
      • the single http service docker runs in the foreground, Ctrl-C to stop container
    • production: a variant of staging with diff env vars
      • the single http service will respond to platform-specific terminate/kill signals
      • generally the platforms will rotate in a new container instance when you deploy a new version and directing traffic there when the container is ready/healthy.
  • required: pre-fill .env.* files prior to starting app instances
    • e.g. if testing in staging, fill out frontend/.env.staging then just build-image-staging && just run to take your app into the container and launch the server on http://localhost:30000

Deployment Instructions - Manual, without our justfile recipes

Refer to the justfile for step by step recipes. The following describes the requirements if you choose to re-implement in a different environment.

A. Python Server

  1. cd backend
    cp .env.example .env
    
  2. In backend/.env, fill in GOOGLE_SEARCH_API_KEY and GOOGLE_SEARCH_ENGINE_ID credentials from Google Custom Search API.

  3. Fill in GROQ_API_KEY credentials from Groq.

  4. Setup virtual environment, packages, and deploy the server

    uv venv
    . .venv/bin/activate
    uv pip install -r requirements.txt
    python app.py
    

    This is fine for dev testing.

  5. Wherever you run this backend, you need to define env var DOMAINS_ALLOW to match the frontend domain the browser sees.

    For production, check docker/ for example containerized/cloud process management scripts.

    You may choose to do add-on engineering with supervisord, nginx or a variety of modifications.

    Furthermore, in production environments you should set the secrets according the platform best practices, you should expect a secrets get/set API or CLI, e.g. in our Fly.io example you would use fly secrets set|unset prior to deploying your app.

B. React Frontend

The React app can be compiled into a static site you can serve with nginx, npx serve or your choice of framework.

  1. cd frontend
    
  2. Update REACT_APP_API_URL in constants.js to point to your server

  3. Install Bun TL;DR: curl -fsSL https://bun.com/install | bash, or use npx bun if you already have npx

    bun install
    bun run build:dev
    bun run build:staging
    bun run build:prod
    

    There are justfile recipes for all of the above.

  4. In dev testing, to start the server:

    just frontend-dev
    PORT=30000 bun start ./build-[dev|staging|prod]
    
  5. In staging the docker app on your host, to start the server:

    Fill in values in frontend/.env.staging. Refer to the justfile recipes for implementation details.

    just run
    

Contributors

  • git add -u your modified files and run pre-commit to perform ruff lint/format checks

TODOS

  • Clarify the pre-existing Cloudfront deployment strategy for the frontend
  • Create ./deployment/cloudflare example for Cloudflare Containers

评论

暂无评论