mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 00:23:17 +00:00
update
This commit is contained in:
15
README.md
15
README.md
@@ -19,10 +19,10 @@
|
|||||||
<a href="https://discord.gg/n5BX8dh8rU"></a>
|
<a href="https://discord.gg/n5BX8dh8rU"></a>
|
||||||
<a href="https://twitter.com/docsgptai"></a>
|
<a href="https://twitter.com/docsgptai"></a>
|
||||||
|
|
||||||
<a href="https://docs.docsgpt.cloud/quickstart">⚡️ Quickstart</a> • <a href="https://app.docsgpt.cloud/">☁️ Cloud Version</a> • <a href="https://discord.gg/n5BX8dh8rU">💬 Discord</a>
|
<a href="https://docs.docsgpt.cloud/quickstart">⚡️ Quickstart</a> • <a href="https://app.docsgpt.cloud/">☁️ Cloud Version</a> • <a href="https://discord.gg/n5BX8dh8rU">💬 Discord</a>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://docs.docsgpt.cloud/">📖 Documentation</a> • <a href="https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md">👫 Contribute</a> • <a href="https://blog.docsgpt.cloud/">🗞 Blog</a>
|
<a href="https://docs.docsgpt.cloud/">📖 Documentation</a> • <a href="https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md">👫 Contribute</a> • <a href="https://blog.docsgpt.cloud/">🗞 Blog</a>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div align="center">
|
<div align="center">
|
||||||
@@ -71,11 +71,10 @@ We're eager to provide personalized assistance when deploying your DocsGPT to a
|
|||||||
|
|
||||||
## Join the Lighthouse Program 🌟
|
## Join the Lighthouse Program 🌟
|
||||||
|
|
||||||
Calling all developers and GenAI innovators! The **DocsGPT Lighthouse Program** connects technical leaders actively deploying or extending DocsGPT in real-world scenarios. Collaborate directly with our team to shape the roadmap, access priority support, and build enterprise-ready solutions with exclusive community insights.
|
Calling all developers and GenAI innovators! The **DocsGPT Lighthouse Program** connects technical leaders actively deploying or extending DocsGPT in real-world scenarios. Collaborate directly with our team to shape the roadmap, access priority support, and build enterprise-ready solutions with exclusive community insights.
|
||||||
|
|
||||||
[Learn More & Apply →](https://docs.google.com/forms/d/1KAADiJinUJ8EMQyfTXUIGyFbqINNClNR3jBNWq7DgTE)
|
[Learn More & Apply →](https://docs.google.com/forms/d/1KAADiJinUJ8EMQyfTXUIGyFbqINNClNR3jBNWq7DgTE)
|
||||||
|
|
||||||
|
|
||||||
## QuickStart
|
## QuickStart
|
||||||
|
|
||||||
> [!Note]
|
> [!Note]
|
||||||
@@ -106,7 +105,7 @@ A more detailed [Quickstart](https://docs.docsgpt.cloud/quickstart) is available
|
|||||||
PowerShell -ExecutionPolicy Bypass -File .\setup.ps1
|
PowerShell -ExecutionPolicy Bypass -File .\setup.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
Either script will guide you through setting up DocsGPT. Four options available: using the public API, running locally, connecting to a local inference engine, or using a cloud API provider. Scripts will automatically configure your `.env` file and handle necessary downloads and installations based on your chosen option.
|
Either script will guide you through setting up DocsGPT. Four options available: using the public API, running locally, connecting to a local inference engine, or using a cloud API provider. Scripts will automatically configure your `.env` file and handle necessary downloads and installations based on your chosen option.
|
||||||
|
|
||||||
**Navigate to http://localhost:5173/**
|
**Navigate to http://localhost:5173/**
|
||||||
|
|
||||||
@@ -115,6 +114,7 @@ To stop DocsGPT, open a terminal in the `DocsGPT` directory and run:
|
|||||||
```bash
|
```bash
|
||||||
docker compose -f deployment/docker-compose.yaml down
|
docker compose -f deployment/docker-compose.yaml down
|
||||||
```
|
```
|
||||||
|
|
||||||
(or use the specific `docker compose down` command shown after running the setup script).
|
(or use the specific `docker compose down` command shown after running the setup script).
|
||||||
|
|
||||||
> [!Note]
|
> [!Note]
|
||||||
@@ -142,7 +142,6 @@ Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information abou
|
|||||||
|
|
||||||
We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing.
|
We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing.
|
||||||
|
|
||||||
|
|
||||||
## Many Thanks To Our Contributors⚡
|
## Many Thanks To Our Contributors⚡
|
||||||
|
|
||||||
<a href="https://github.com/arc53/DocsGPT/graphs/contributors" alt="View Contributors">
|
<a href="https://github.com/arc53/DocsGPT/graphs/contributors" alt="View Contributors">
|
||||||
|
|||||||
@@ -37,33 +37,33 @@ While modifying `settings.py` offers more flexibility, it's generally recommende
|
|||||||
|
|
||||||
Here are some of the most fundamental settings you'll likely want to configure:
|
Here are some of the most fundamental settings you'll likely want to configure:
|
||||||
|
|
||||||
- **`LLM_PROVIDER`**: This setting determines which Large Language Model (LLM) provider DocsGPT will use. It tells DocsGPT which API to interact with.
|
- **`LLM_PROVIDER`**: This setting determines which Large Language Model (LLM) provider DocsGPT will use. It tells DocsGPT which API to interact with.
|
||||||
|
|
||||||
- **Common values:**
|
- **Common values:**
|
||||||
- `docsgpt`: Use the DocsGPT Public API Endpoint (simple and free, as offered in `setup.sh` option 1).
|
- `docsgpt`: Use the DocsGPT Public API Endpoint (simple and free, as offered in `setup.sh` option 1).
|
||||||
- `openai`: Use OpenAI's API (requires an API key).
|
- `openai`: Use OpenAI's API (requires an API key).
|
||||||
- `google`: Use Google's Vertex AI or Gemini models.
|
- `google`: Use Google's Vertex AI or Gemini models.
|
||||||
- `anthropic`: Use Anthropic's Claude models.
|
- `anthropic`: Use Anthropic's Claude models.
|
||||||
- `groq`: Use Groq's models.
|
- `groq`: Use Groq's models.
|
||||||
- `huggingface`: Use HuggingFace Inference API.
|
- `huggingface`: Use HuggingFace Inference API.
|
||||||
- `azure_openai`: Use Azure OpenAI Service.
|
- `azure_openai`: Use Azure OpenAI Service.
|
||||||
- `openai` (when using local inference engines like Ollama, Llama.cpp, TGI, etc.): This signals DocsGPT to use an OpenAI-compatible API format, even if the actual LLM is running locally.
|
- `openai` (when using local inference engines like Ollama, Llama.cpp, TGI, etc.): This signals DocsGPT to use an OpenAI-compatible API format, even if the actual LLM is running locally.
|
||||||
|
|
||||||
- **`LLM_NAME`**: Specifies the specific model to use from the chosen LLM provider. The available models depend on the `LLM_PROVIDER` you've selected.
|
- **`LLM_NAME`**: Specifies the specific model to use from the chosen LLM provider. The available models depend on the `LLM_PROVIDER` you've selected.
|
||||||
|
|
||||||
- **Examples:**
|
- **Examples:**
|
||||||
- For `LLM_PROVIDER=openai`: `gpt-4o`
|
- For `LLM_PROVIDER=openai`: `gpt-4o`
|
||||||
- For `LLM_PROVIDER=google`: `gemini-2.0-flash`
|
- For `LLM_PROVIDER=google`: `gemini-2.0-flash`
|
||||||
- For local models (e.g., Ollama): `llama3.2:1b` (or any model name available in your setup).
|
- For local models (e.g., Ollama): `llama3.2:1b` (or any model name available in your setup).
|
||||||
|
|
||||||
- **`EMBEDDINGS_NAME`**: This setting defines which embedding model DocsGPT will use to generate vector embeddings for your documents. Embeddings are numerical representations of text that allow DocsGPT to understand the semantic meaning of your documents for efficient search and retrieval.
|
- **`EMBEDDINGS_NAME`**: This setting defines which embedding model DocsGPT will use to generate vector embeddings for your documents. Embeddings are numerical representations of text that allow DocsGPT to understand the semantic meaning of your documents for efficient search and retrieval.
|
||||||
|
|
||||||
- **Default value:** `huggingface_sentence-transformers/all-mpnet-base-v2` (a good general-purpose embedding model).
|
- **Default value:** `huggingface_sentence-transformers/all-mpnet-base-v2` (a good general-purpose embedding model).
|
||||||
- **Other options:** You can explore other embedding models from Hugging Face Sentence Transformers or other providers if needed.
|
- **Other options:** You can explore other embedding models from Hugging Face Sentence Transformers or other providers if needed.
|
||||||
|
|
||||||
- **`API_KEY`**: Required for most cloud-based LLM providers. This is your authentication key to access the LLM provider's API. You'll need to obtain this key from your chosen provider's platform.
|
- **`API_KEY`**: Required for most cloud-based LLM providers. This is your authentication key to access the LLM provider's API. You'll need to obtain this key from your chosen provider's platform.
|
||||||
|
|
||||||
- **`OPENAI_BASE_URL`**: Specifically used when `LLM_PROVIDER` is set to `openai` but you are connecting to a local inference engine (like Ollama, Llama.cpp, etc.) that exposes an OpenAI-compatible API. This setting tells DocsGPT where to find your local LLM server.
|
- **`OPENAI_BASE_URL`**: Specifically used when `LLM_PROVIDER` is set to `openai` but you are connecting to a local inference engine (like Ollama, Llama.cpp, etc.) that exposes an OpenAI-compatible API. This setting tells DocsGPT where to find your local LLM server.
|
||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
@@ -93,51 +93,82 @@ OPENAI_BASE_URL=http://host.docker.internal:11434/v1 # Default Ollama API URL wi
|
|||||||
EMBEDDINGS_NAME=huggingface_sentence-transformers/all-mpnet-base-v2 # You can also run embeddings locally if needed
|
EMBEDDINGS_NAME=huggingface_sentence-transformers/all-mpnet-base-v2 # You can also run embeddings locally if needed
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case, even though you are using Ollama locally, `LLM_PROVIDER` is set to `openai` because Ollama (and many other local inference engines) are designed to be API-compatible with OpenAI. `OPENAI_BASE_URL` points DocsGPT to the local Ollama server.
|
In this case, even though you are using Ollama locally, `LLM_PROVIDER` is set to `openai` because Ollama (and many other local inference engines) are designed to be API-compatible with OpenAI. `OPENAI_BASE_URL` points DocsGPT to the local Ollama server.
|
||||||
|
|
||||||
## Authentication Settings
|
## Authentication Settings
|
||||||
|
|
||||||
DocsGPT includes a JWT (JSON Web Token) based authentication feature for managing sessions or securing local deployments while allowing access.
|
DocsGPT includes a JWT (JSON Web Token) based authentication feature for managing sessions or securing local deployments while allowing access.
|
||||||
|
|
||||||
- **`AUTH_TYPE`**: This setting in your `.env` file or `settings.py` determines the authentication method.
|
### `AUTH_TYPE` Overview
|
||||||
|
|
||||||
- **Possible values:**
|
|
||||||
- `None` (or not set): No authentication is used.
|
|
||||||
- `simple_jwt`: A single, long-lived JWT token is generated and used for all authenticated requests. This is useful for securing a local deployment with a shared secret.
|
|
||||||
- `session_jwt`: Unique JWT tokens are generated for sessions, typically for individual users or temporary access.
|
|
||||||
- If `AUTH_TYPE` is set to `simple_jwt` or `session_jwt`, then a `JWT_SECRET_KEY` is required.
|
|
||||||
- **`JWT_SECRET_KEY`**: This is a crucial secret key used to sign and verify JWTs.
|
|
||||||
|
|
||||||
- It can be set directly in your `.env` file or `settings.py`.
|
|
||||||
- **Automatic Key Generation**: If `AUTH_TYPE` is `simple_jwt` or `session_jwt` and `JWT_SECRET_KEY` is _not_ set in your environment variables or `settings.py`, DocsGPT will attempt to:
|
|
||||||
1. Read the key from a file named `.jwt_secret_key` in the project's root directory.
|
|
||||||
2. If the file doesn't exist, it will generate a new 32-byte random key, save it to `.jwt_secret_key`, and use it for the session. This ensures that the key persists across application restarts.
|
|
||||||
- **Security Note**: It's vital to keep this key secure. If you set it manually, choose a strong, random string.
|
|
||||||
|
|
||||||
**How it works:**
|
The `AUTH_TYPE` setting in your `.env` file or `settings.py` determines the authentication method used by DocsGPT. This allows you to control how users authenticate with your DocsGPT instance.
|
||||||
|
|
||||||
- When `AUTH_TYPE` is set to `simple_jwt`, a token is generated at startup (if not already present or configured) and printed to the console. This token should be included in the `Authorization` header of your API requests as a Bearer token (e.g., `Authorization: Bearer YOUR_SIMPLE_JWT_TOKEN`).
|
| Value | Description |
|
||||||
- When `AUTH_TYPE` is set to `session_jwt`:
|
| ------------- | ------------------------------------------------------------------------------------------- |
|
||||||
- Clients can request a new token from the `/api/generate_token` endpoint.
|
| `None` | No authentication is used. Anyone can access the app. |
|
||||||
- This token should then be included in the `Authorization` header for subsequent requests.
|
| `simple_jwt` | A single, long-lived JWT token is generated at startup. All requests use this shared token. |
|
||||||
- The backend verifies the JWT token provided in the `Authorization` header for protected routes.
|
| `session_jwt` | Unique JWT tokens are generated for each session/user. |
|
||||||
- The `/api/config` endpoint can be used to check the current `auth_type` and whether authentication is required.
|
|
||||||
|
|
||||||
**Frontend Token Input for `simple_jwt`:**
|
#### How to Configure
|
||||||
|
|
||||||
<img
|
Add the following to your `.env` file (or set in `settings.py`):
|
||||||
src="/jwt-input.png"
|
|
||||||
alt="Frontend prompt for JWT Token"
|
```env
|
||||||
style={{
|
# No authentication (default)
|
||||||
width: '500px',
|
AUTH_TYPE=None
|
||||||
maxWidth: '100%',
|
|
||||||
display: 'block',
|
# OR: Simple JWT (shared token)
|
||||||
margin: '1em auto'
|
AUTH_TYPE=simple_jwt
|
||||||
}}
|
JWT_SECRET_KEY=your_secret_key_here
|
||||||
|
|
||||||
|
# OR: Session JWT (per-user/session tokens)
|
||||||
|
AUTH_TYPE=session_jwt
|
||||||
|
JWT_SECRET_KEY=your_secret_key_here
|
||||||
|
```
|
||||||
|
|
||||||
|
- If `AUTH_TYPE` is set to `simple_jwt` or `session_jwt`, a `JWT_SECRET_KEY` is required.
|
||||||
|
- If `JWT_SECRET_KEY` is not set, DocsGPT will generate one and store it in `.jwt_secret_key` in the project root.
|
||||||
|
|
||||||
|
#### How Each Method Works
|
||||||
|
|
||||||
|
- **None**: No authentication. All API and UI access is open.
|
||||||
|
- **simple_jwt**:
|
||||||
|
- A single JWT token is generated at startup and printed to the console.
|
||||||
|
- Use this token in the `Authorization` header for all API requests:
|
||||||
|
```http
|
||||||
|
Authorization: Bearer <SIMPLE_JWT_TOKEN>
|
||||||
|
```
|
||||||
|
- The frontend will prompt for this token if not already set.
|
||||||
|
- **session_jwt**:
|
||||||
|
- Clients can request a new token from `/api/generate_token`.
|
||||||
|
- Use the received token in the `Authorization` header for subsequent requests.
|
||||||
|
- Each user/session gets a unique token.
|
||||||
|
|
||||||
|
#### Security Notes
|
||||||
|
|
||||||
|
- Always keep your `JWT_SECRET_KEY` secure and private.
|
||||||
|
- If you set it manually, use a strong, random string.
|
||||||
|
- If not set, DocsGPT will generate a secure key and persist it in `.jwt_secret_key`.
|
||||||
|
|
||||||
|
#### Checking Current Auth Type
|
||||||
|
|
||||||
|
- Use the `/api/config` endpoint to check the current `auth_type` and whether authentication is required.
|
||||||
|
|
||||||
|
#### Frontend Token Input for `simple_jwt`
|
||||||
|
|
||||||
|
If you have configured `AUTH_TYPE=simple_jwt`, the DocsGPT frontend will prompt you to enter the JWT token if it's not already set or is invalid. Paste the `SIMPLE_JWT_TOKEN` (printed to your console when the backend starts) into this field to access the application.
|
||||||
|
|
||||||
|
<img
|
||||||
|
src="/jwt-input.png"
|
||||||
|
alt="Frontend prompt for JWT Token"
|
||||||
|
style={{
|
||||||
|
width: "500px",
|
||||||
|
maxWidth: "100%",
|
||||||
|
display: "block",
|
||||||
|
margin: "1em auto",
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
If you have configured `AUTH_TYPE=simple_jwt`, the DocsGPT frontend will prompt you to enter the JWT token if it's not already set or is invalid. You'll need to paste the `SIMPLE_JWT_TOKEN` (which is printed to your console when the backend starts) into this field to access the application.
|
|
||||||
|
|
||||||
## Exploring More Settings
|
## Exploring More Settings
|
||||||
|
|
||||||
These are just the basic settings to get you started. The `settings.py` file contains many more advanced options that you can explore to further customize DocsGPT, such as:
|
These are just the basic settings to get you started. The `settings.py` file contains many more advanced options that you can explore to further customize DocsGPT, such as:
|
||||||
@@ -147,4 +178,4 @@ These are just the basic settings to get you started. The `settings.py` file con
|
|||||||
- Cache settings (`CACHE_REDIS_URL`)
|
- Cache settings (`CACHE_REDIS_URL`)
|
||||||
- And many more!
|
- And many more!
|
||||||
|
|
||||||
For a complete list of available settings and their descriptions, refer to the `settings.py` file in `application/core`. Remember to restart your Docker containers after making changes to your `.env` file or `settings.py` for the changes to take effect.
|
For a complete list of available settings and their descriptions, refer to the `settings.py` file in `application/core`. Remember to restart your Docker containers after making changes to your `.env` file or `settings.py` for the changes to take effect.
|
||||||
|
|||||||
6
package-lock.json
generated
Normal file
6
package-lock.json
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "DocsGPT",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user