37
37
mode : openai
38
38
39
39
openai :
40
+ api_base : <openai-api-base-url> # Defaults to https://api.openai.com/v1
40
41
api_key : <your_openai_api_key> # You could skip this configuration and use the OPENAI_API_KEY env var instead
41
42
model : <openai_model_to_use> # Optional model to use. Default is "gpt-3.5-turbo"
42
43
# Note: Open AI Models are listed here: https://platform.openai.com/docs/models
@@ -55,6 +56,24 @@ Navigate to http://localhost:8001 to use the Gradio UI or to http://localhost:80
55
56
You'll notice the speed and quality of response is higher, given you are using OpenAI's servers for the heavy
56
57
computations.
57
58
59
+ ### Using OpenAI compatible API
60
+
61
+ Many tools, including [ LocalAI] ( https://localai.io/ ) and [ vLLM] ( https://docs.vllm.ai/en/latest/ ) ,
62
+ support serving local models with an OpenAI compatible API. Even when overriding the ` api_base ` ,
63
+ using the ` openai ` mode doesn't allow you to use custom models. Instead, you should use the ` openailike ` mode:
64
+
65
+ ``` yaml
66
+ llm :
67
+ mode : openailike
68
+ ` ` `
69
+
70
+ This mode uses the same settings as the ` openai` mode.
71
+
72
+ As an example, you can follow the [vLLM quickstart guide](https://docs.vllm.ai/en/latest/getting_started/quickstart.html#openai-compatible-server)
73
+ to run an OpenAI compatible server. Then, you can run PrivateGPT using the `settings-vllm.yaml` profile :
74
+
75
+ ` PGPT_PROFILES=vllm make run`
76
+
58
77
# ## Using AWS Sagemaker
59
78
60
79
For a fully private & performant setup, you can choose to have both your LLM and Embeddings model deployed using Sagemaker.
82
101
` PGPT_PROFILES=sagemaker poetry run python -m private_gpt`
83
102
84
103
When the server is started it will print a log *Application startup complete*.
85
- Navigate to http://localhost:8001 to use the Gradio UI or to http://localhost:8001/docs (API section) to try the API.
104
+ Navigate to http://localhost:8001 to use the Gradio UI or to http://localhost:8001/docs (API section) to try the API.
0 commit comments