Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

llm_api_key_setup.md 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. sidebar_position: 5
  3. slug: /llm_api_key_setup
  4. ---
  5. # Configure your API key
  6. An API key is required for RAGFlow to interact with an online AI model. This guide provides information about setting your API key in RAGFlow.
  7. ## Get your API key
  8. For now, RAGFlow supports the following online LLMs. Click the corresponding link to apply for your API key. Most LLM providers grant newly-created accounts trial credit, which will expire in a couple of months, or a promotional amount of free quota.
  9. - [OpenAI](https://platform.openai.com/login?launch)
  10. - [Azure-OpenAI](https://ai.azure.com/)
  11. - [Gemini](https://aistudio.google.com/)
  12. - [Groq](https://console.groq.com/)
  13. - [Mistral](https://mistral.ai/)
  14. - [Bedrock](https://aws.amazon.com/cn/bedrock/)
  15. - [Tongyi-Qianwen](https://dashscope.console.aliyun.com/model)
  16. - [ZHIPU-AI](https://open.bigmodel.cn/)
  17. - [MiniMax](https://platform.minimaxi.com/)
  18. - [Moonshot](https://platform.moonshot.cn/docs)
  19. - [DeepSeek](https://platform.deepseek.com/api-docs/)
  20. - [Baichuan](https://www.baichuan-ai.com/home)
  21. - [VolcEngine](https://www.volcengine.com/docs/82379)
  22. - [Jina](https://jina.ai/reader/)
  23. - [OpenRouter](https://openrouter.ai/)
  24. - [StepFun](https://platform.stepfun.com/)
  25. :::note
  26. If you find your online LLM is not on the list, don't feel disheartened. The list is expanding, and you can [file a feature request](https://github.com/infiniflow/ragflow/issues/new?assignees=&labels=feature+request&projects=&template=feature_request.yml&title=%5BFeature+Request%5D%3A+) with us! Alternatively, if you have customized or locally-deployed models, you can [bind them to RAGFlow using Ollama, Xinferenc, or LocalAI](./deploy_local_llm.mdx).
  27. :::
  28. ## Configure your API key
  29. You have two options for configuring your API key:
  30. - Configure it in **service_conf.yaml** before starting RAGFlow.
  31. - Configure it on the **Model Providers** page after logging into RAGFlow.
  32. ### Configure API key before starting up RAGFlow
  33. 1. Navigate to **./docker/ragflow**.
  34. 2. Find entry **user_default_llm**:
  35. - Update `factory` with your chosen LLM.
  36. - Update `api_key` with yours.
  37. - Update `base_url` if you use a proxy to connect to the remote service.
  38. 3. Reboot your system for your changes to take effect.
  39. 4. Log into RAGFlow.
  40. *After logging into RAGFlow, you will find your chosen model appears under **Added models** on the **Model Providers** page.*
  41. ### Configure API key after logging into RAGFlow
  42. :::caution WARNING
  43. After logging into RAGFlow, configuring API key through the **service_conf.yaml** file will no longer take effect.
  44. :::
  45. After logging into RAGFlow, you can *only* configure API Key on the **Model Providers** page:
  46. 1. Click on your logo on the top right of the page **>** **Model Providers**.
  47. 2. Find your model card under **Models to be added** and click **Add the model**:
  48. ![add model](https://github.com/infiniflow/ragflow/assets/93570324/07e43f63-367c-4c9c-8ed3-8a3a24703f4e)
  49. 3. Paste your API key.
  50. 4. Fill in your base URL if you use a proxy to connect to the remote service.
  51. 5. Click **OK** to confirm your changes.
  52. :::note
  53. If you wish to update an existing API key at a later point:
  54. ![update api key](https://github.com/infiniflow/ragflow/assets/93570324/0bfba679-33f7-4f6b-9ed6-f0e6e4b228ad)
  55. :::