MindSearch
Updated: April 15, 2025
1. Obtain API Key
- Open the SiliconFlow website and register an account (if you have registered, log in directly).
- After completing the registration, go to the API Keys, create a new API Key, and copy the key for future use.
2. Deploy MindSearch
-
Clone MindSearch to your local machine and install the required dependencies (refer to https://github.com/InternLM/MindSearch/blob/main/README.md).
-
Modify:
/path/to/MindSearch/mindsearch/models.py -
Add the configuration for calling the SiliconFlow API. The configuration is as follows:
internlm_silicon = dict(type=GPTAPI,
model_type='Pro/zai-org/GLM-5.1',
key=os.environ.get('SILICON_API_KEY', 'YOUR SILICON API KEY'),
openai_api_base='https://api.siliconflow.cn/v1/chat/completions',
meta_template=[
dict(role='system', api_role='system'),
dict(role='user', api_role='user'),
dict(role='assistant', api_role='assistant'),
dict(role='environment', api_role='system')
],
top_p=0.8,
top_k=1,
temperature=0,
max_new_tokens=8192,
repetition_penalty=1.02,
stop_words=['<|im_end|>'])After adding this configuration, you can execute the relevant commands to start MindSearch.
- Start the backend:
# 指定硅基流动的 API Key
export SILICON_API_KEY=上面流程中复制的密钥
# 启动
python -m mindsearch.app --lang en --model_format internlm_silicon --search_engine DuckDuckGoSearch- Start the frontend. Here, we use Gradio as an example. For other frontends, refer to MindSearch's README:
python frontend/mindsearch_gradio.py
3. Upload to HuggingFace Space
We can also choose to deploy it to a HuggingFace Space.
- Create a new Space on https://huggingface.co/new-space, configure it as:
Gradio Template: Blank Hardware: CPU basic · 2 vCPU · 16GB · FREE
-
After creating the Space, go to "Settings" and set the API Key.
-
Upload the MindSearch directory, requirements.txt, and an app.py file.
The detailed content of app.py can be found at: https://huggingface.co/spaces/SmartFlowAI/MindSearch_X_SiliconFlow/blob/main/app.py