Introduction to Search with Lepton
Search with Lepton is an innovative project that aims to simplify the creation of conversational search engines. By requiring fewer than 500 lines of code, it allows individuals and businesses to build their own customized search solutions. The project emphasizes ease of setup and flexibility, making it accessible even to those with minimal programming experience.
Key Features
The primary features of Search with Lepton include:
- Built-in LLM Support: The project comes integrated with large language model (LLM) capabilities, allowing it to handle conversational queries efficiently.
- Search Engine Integration: It supports integration with major search engines, ensuring comprehensive and relevant search results.
- Customizable User Interface: Users can tailor the UI to meet their specific needs, enhancing the user experience.
- Cached and Shareable Results: Search results can be cached for faster retrieval, and easily shared across different platforms.
Setting Up the Search Engine API
Search with Lepton supports two main search engines: Bing and Google.
Bing Search
To enable Bing searching, users need to obtain a subscription key from the Bing Web Search API. This key is necessary for making search requests.
Google Search
For Google Search support, there are several options:
- SearchApi: Utilize the SearchApi provided by Google.
- Serper: Set up using the Serper Google Search API.
- Programmable Search Engine: Opt for Google's Programmable Search Engine for customized search capabilities.
Configuring LLM and KV
Lepton recommends using its built-in LLM and KV (key-value) functions. Users can set up these functionalities by executing a simple command, making it straightforward to integrate these complex technologies into their search engine.
pip install -U leptonai openai && lep login
Obtaining the Lepton AI Workspace Token
Every user will need a workspace token from the Lepton AI Dashboard. This token is crucial for building and deploying the search engine.
Building the Project
Building your search engine involves a series of straightforward steps:
- Set the Bing Subscription Key:
export BING_SEARCH_V7_SUBSCRIPTION_KEY=YOUR_BING_SUBSCRIPTION_KEY
- Set the Lepton AI Workspace Token:
export LEPTON_WORKSPACE_TOKEN=YOUR_LEPTON_WORKSPACE_TOKEN
- Build the Web Interface:
cd web && npm install && npm run build
- Running the Server:
BACKEND=BING python search_with_lepton.py
For those using Google Search, different API keys need to be specified based on the chosen service (SearchApi, Serper, or Programmable Search Engine).
Deployment
Deploying the search engine is as easy as building it. Lepton AI offers a one-click deployment feature, allowing users to launch their search solution quickly. Alternatively, users can deploy their customized version using a simple command line tool, lep photon
.
lep photon run -n search-with-lepton-modified -m search_with_lepton.py --env BACKEND=BING --env BING_SEARCH_V7_SUBSCRIPTION_KEY=YOUR_BING_SUBSCRIPTION_KEY
Conclusion
Search with Lepton is a powerful yet accessible tool for creating conversational search engines. With its robust features and user-friendly setup process, it offers an excellent solution for anyone looking to harness the power of modern search capabilities. Whether for personal use or professional deployment, Lepton makes building a search engine both feasible and efficient.