Open-source AI-powered search engine. (Perplexity Clone)
Run your local LLM (llama3, gemma, mistral, phi3) or use cloud models (Groq/Llama3, OpenAI/gpt4-o)
Demo answering questions with llama3 on my M1 Macbook Pro:
local-demo.mp4
Please feel free to contact me on Twitter or create an issue if you have any questions.
farfalle.dev (Cloud models only)
- 🛠️ Tech Stack
- 🏃🏿♂️ Getting Started
- 🚀 Deploy
- Add support for local LLMs through Ollama
- Docker deployment setup
- Add support for searxng. Eliminates the need for external dependencies.
- Integrate with LiteLLM
- Frontend: Next.js
- Backend: FastAPI
- Search API: SearXNG or Tavily
- Logging: Logfire
- Rate Limiting: Redis
- Components: shadcn/ui
- Search with multiple search providers (Tavily, Searxng)
- Answer questions with cloud models (OpenAI/gpt4-o, OpenAI/gpt3.5-turbo, Groq/Llama3)
- Answer questions with local models (llama3, mistral, gemma, phi3)
- Docker
- Ollama (If running local models)
- Download any of the supported models: llama3, mistral, gemma, phi3
- Start ollama server
ollama serve
git clone git@github.com:rashadphz/farfalle.git
cd farfalle
touch .env
Add the following variables to the .env file:
You can use Tavily or Searxng as the search provider.
Tavily (Requires API Key)
TAVILY_API_KEY=...
SEARCH_PROVIDER=tavily
Searxng (No API Key Required)
SEARCH_PROVIDER=searxng
# Cloud Models
OPENAI_API_KEY=...
GROQ_API_KEY=...
This requires Docker Compose version 2.22.0 or later.
docker-compose -f docker-compose.dev.yaml up -d
Visit http://localhost:3000 to view the app.
For custom setup instructions, see custom-setup-instructions.md
After the backend is deployed, copy the web service URL to your clipboard. It should look something like: https://some-service-name.onrender.com.
Use the copied backend URL in the NEXT_PUBLIC_API_URL
environment variable when deploying with Vercel.
And you're done! 🥳
To use Farfalle as your default search engine, follow these steps:
- Visit the settings of your browser
- Go to 'Search Engines'
- Create a new search engine entry using this URL: http://localhost:3000/?q=%s.
- Add the search engine.