From 1bf64b310274a5907c4c38299cec04e9c998da1c Mon Sep 17 00:00:00 2001 From: Oleg Ivaniv Date: Thu, 25 Apr 2024 13:58:57 +0200 Subject: [PATCH 01/12] Update Ollama chat + lm options docs Signed-off-by: Oleg Ivaniv --- .../n8n-nodes-langchain.lmchatollama.md | 26 +++++++++++++----- .../sub-nodes/n8n-nodes-langchain.lmollama.md | 27 +++++++++++++------ 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md index 4a5c15b60..782116dfb 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md @@ -21,17 +21,29 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama ## Node parameters -* **Model**: the model that generates the completion. Choose from: - * Llama2 - * Llama2 13B - * Llama2 70B - * Llama2 Uncensored +* **Model**: the model that generates the completion. The models options are fetched from the Ollama API running on the provided credential URL. ## Node options * **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. -* **Top K**: the number of token choices the model uses to generate the next token. -* **Top P**: use a lower value to ignore less probable options. +* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to -1 to disable. Valid range is between -1 and 100. +* **Top P**: chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions. Valid range is between 0 and 1. +* **Frequency Penalty**: adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition. Must be a non-negative number. +* **Keep Alive**: specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m (1 hour 30 minutes). +* **Low VRAM Mode**: whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory. +* **Main GPU ID**: specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs. +* **Context Batch Size**: sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage. +* **Context Length**: the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model. +* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to -1 for auto-detection. +* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to -1 for no limit. Be cautious when setting this to a large value, as it can lead to very long outputs. +* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to 0 for auto-detection. +* **Penalize Newlines**: whether the model will be less likely to generate newline characters, encouraging longer continuous sequences of text. +* **Presence Penalty**: adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity. +* **Repetition Penalty**: adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to 1.0 to disable repetition penalty. +* **Use Memory Locking**: whether to lock the model in memory to prevent swapping. This can improve performance but requires sufficient available memory. +* **Use Memory Mapping**: whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled. +* **Load Vocabulary Only**: whether to only load the model vocabulary without the weights. Useful for quickly testing tokenization. +* **Output Format**: specifies the format of the API response. Choose between 'Default' and 'JSON'. ## Related resources diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md index b56c1e978..4555b0a96 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md @@ -20,18 +20,29 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama ## Node parameters -* **Model**: the model that generates the completion. Choose from: - * Llama2 - * Llama2 13B - * Llama2 70B - * Llama2 Uncensored +* **Model**: the model that generates the completion. The models options are fetched from the Ollama API running on the provided credential URL. ## Node options * **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. -* **Top K**: the number of token choices the model uses to generate the next token. -* **Top P**: use a lower value to ignore less probable options. - +* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to -1 to disable. Valid range is between -1 and 100. +* **Top P**: chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions. Valid range is between 0 and 1. +* **Frequency Penalty**: adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition. Must be a non-negative number. +* **Keep Alive**: specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m (1 hour 30 minutes). +* **Low VRAM Mode**: whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory. +* **Main GPU ID**: specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs. +* **Context Batch Size**: sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage. +* **Context Length**: the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model. +* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to -1 for auto-detection. +* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to -1 for no limit. Be cautious when setting this to a large value, as it can lead to very long outputs. +* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to 0 for auto-detection. +* **Penalize Newlines**: whether the model will be less likely to generate newline characters, encouraging longer continuous sequences of text. +* **Presence Penalty**: adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity. +* **Repetition Penalty**: adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to 1.0 to disable repetition penalty. +* **Use Memory Locking**: whether to lock the model in memory to prevent swapping. This can improve performance but requires sufficient available memory. +* **Use Memory Mapping**: whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled. +* **Load Vocabulary Only**: whether to only load the model vocabulary without the weights. Useful for quickly testing tokenization. +* **Output Format**: specifies the format of the API response. Choose between 'Default' and 'JSON'. ## Related resources From 7ac864a9e7a3a345717d4f7abba1588a72383c5d Mon Sep 17 00:00:00 2001 From: Maria <123465523+mariaremote@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:36:45 +0200 Subject: [PATCH 02/12] improved documenation with reference to user types in consenst screen --- .../builtin/credentials/google/oauth-generic.md | 7 +++++++ .../credentials/google/oauth-single-service.md | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/integrations/builtin/credentials/google/oauth-generic.md b/docs/integrations/builtin/credentials/google/oauth-generic.md index e4a7882a7..e8498141f 100644 --- a/docs/integrations/builtin/credentials/google/oauth-generic.md +++ b/docs/integrations/builtin/credentials/google/oauth-generic.md @@ -49,6 +49,8 @@ This document contains instructions for creating a generic OAuth2 Google credent 5. Select **CREATE**. 6. Enable each Google service API that you want to use: + + 1. If using Google Perspective or Google Ads: [Request API Access for Perspective](https://developers.perspectiveapi.com/s/docs-get-started){:targe=_blank .external-link} or a [Developer Token for Ads](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:targe=_blank .external-link}. --8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md" ### Create and test your connection @@ -61,6 +63,8 @@ In n8n: The following video demonstrates the steps described above: +## Video +
@@ -100,3 +104,6 @@ n8n doesn't support all scopes. When creating a generic Google OAuth2 API creden --8<-- "_snippets/integrations/builtin/credentials/google/unverified-app.md" +### Google Cloud app becoming unauthorized + +For Google Cloud apps with **Publishing status** set to **Testing** and **User type** set to **External**, consent and tokens expire after seven days. Refer to [Google Cloud Platform Console Help | Setting up your OAuth consent screen](https://support.google.com/cloud/answer/10311615?hl=en#zippy=%2Ctesting){:target=_blank .external-link} for more information. To resolve this, reconnect the app in the n8n credentials modal. \ No newline at end of file diff --git a/docs/integrations/builtin/credentials/google/oauth-single-service.md b/docs/integrations/builtin/credentials/google/oauth-single-service.md index 9c45816e7..2f22e6bcf 100644 --- a/docs/integrations/builtin/credentials/google/oauth-single-service.md +++ b/docs/integrations/builtin/credentials/google/oauth-single-service.md @@ -19,7 +19,16 @@ This document contains instructions for creating a Google credential for a singl ## Set up OAuth -In Google Cloud: +### Create a new credential in n8n + +1. Follow the steps to [Create a credential](/credentials/add-edit-credentials/). If you create a credential by selecting **Create new** in the credentials dropdown in a node, n8n automatically creates the correct credential type for that node. If you select **Credentials > New**, you must browse for the credential type. To create a credential for a [custom API call](/integrations/custom-operations/), select **Google OAuth2 API**. This allows you to create a generic credential, then set its scopes. +2. Note the **OAuth Redirect URL** from the node credential modal. You'll need this in the next section. + + ??? Details "View screenshot" + ![OAuth Callback URL](/_images/integrations/builtin/credentials/google/oauth_callback.png) + + +### Set up OAuth in Google Cloud 1. Go to [Google Cloud Console | APIs and services](https://console.cloud.google.com/apis/credentials){:target=_blank .external-link} and make sure you're in the project you want to use. @@ -30,7 +39,7 @@ In Google Cloud: ??? Details "View detailed steps" 1. Select **OAuth consent screen**. - 2. For **User Type**, select **Internal**. + 2. As **User Type**, select **Internal** for user access within your organisation's Google workspace or **External** for any user with a Google account. 3. Select **Create**. 4. Enter the essential information: **App name**, **User support email**, and the **Email addresses** field in **Developer contact information**. 5. Add an authorized domain: select **+ ADD DOMAIN**. Enter `n8n.cloud` if using n8n's Cloud service, or the domain of your n8n instance if you're self-hosting. @@ -60,6 +69,8 @@ In Google Cloud: 1. If using Google Perspective or Google Ads: [Request API Access for Perspective](https://developers.perspectiveapi.com/s/docs-get-started){:targe=_blank .external-link} or a [Developer Token for Ads](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:targe=_blank .external-link}. --8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md" +### Create and test your connection + In n8n: 1. Enter your new **Client ID** and **Client Secret** from Google Cloud Console in the credentials modal. @@ -72,7 +83,6 @@ In n8n: - ## Troubleshooting ### Google hasn't verified this app From 88dbb0ba10cd32ea4f3aee0dc1c84ba0238d8a46 Mon Sep 17 00:00:00 2001 From: Deborah Date: Mon, 29 Apr 2024 11:35:48 +0100 Subject: [PATCH 03/12] Apply suggestions from code review --- .../sub-nodes/n8n-nodes-langchain.lmchatollama.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md index 782116dfb..d2649e413 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md @@ -26,7 +26,7 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama ## Node options * **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. -* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to -1 to disable. Valid range is between -1 and 100. +* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to `-1` to disable. Valid range is between -1 and 100. * **Top P**: chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions. Valid range is between 0 and 1. * **Frequency Penalty**: adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition. Must be a non-negative number. * **Keep Alive**: specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m (1 hour 30 minutes). @@ -34,16 +34,16 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama * **Main GPU ID**: specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs. * **Context Batch Size**: sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage. * **Context Length**: the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model. -* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to -1 for auto-detection. -* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to -1 for no limit. Be cautious when setting this to a large value, as it can lead to very long outputs. -* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to 0 for auto-detection. +* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to `-1` for auto-detection. +* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to `-1` for no limit. Be cautious when setting this to a large value, as it can lead to very long outputs. +* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to `0` for auto-detection. * **Penalize Newlines**: whether the model will be less likely to generate newline characters, encouraging longer continuous sequences of text. * **Presence Penalty**: adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity. -* **Repetition Penalty**: adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to 1.0 to disable repetition penalty. +* **Repetition Penalty**: adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to `1.0` to disable repetition penalty. * **Use Memory Locking**: whether to lock the model in memory to prevent swapping. This can improve performance but requires sufficient available memory. * **Use Memory Mapping**: whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled. * **Load Vocabulary Only**: whether to only load the model vocabulary without the weights. Useful for quickly testing tokenization. -* **Output Format**: specifies the format of the API response. Choose between 'Default' and 'JSON'. +* **Output Format**: specifies the format of the API response. Choose between **Default** and **JSON**. ## Related resources From 868ef02865de69a6cac31b8dbc3306ea7423b669 Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Mon, 29 Apr 2024 11:41:52 +0100 Subject: [PATCH 04/12] do some content reuse --- .../langchain-sub-nodes/ollama-options-1.md | 14 +++++++++++++ .../langchain-sub-nodes/ollama-options-2.md | 4 ++++ .../n8n-nodes-langchain.lmchatollama.md | 21 +++---------------- .../sub-nodes/n8n-nodes-langchain.lmollama.md | 21 ++----------------- 4 files changed, 23 insertions(+), 37 deletions(-) create mode 100644 _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md create mode 100644 _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md diff --git a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md new file mode 100644 index 000000000..be67d0cd1 --- /dev/null +++ b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md @@ -0,0 +1,14 @@ +* **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. +* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to `-1` to disable. Valid range is between -1 and 100. +* **Top P**: chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions. Valid range is between 0 and 1. +* **Frequency Penalty**: adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition. Must be a non-negative number. +* **Keep Alive**: specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m (1 hour 30 minutes). +* **Low VRAM Mode**: whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory. +* **Main GPU ID**: specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs. +* **Context Batch Size**: sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage. +* **Context Length**: the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model. +* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to `-1` for autodetection. +* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to `-1` for no limit. Be cautious when setting this to a large value, as it can lead to long outputs. +* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to `0` for autodetection. +* **Penalize Newlines**: reduce the chances of the model generating newline characters, encouraging longer continuous sequences of text. +* **Presence Penalty**: adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity. diff --git a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md new file mode 100644 index 000000000..22541b2de --- /dev/null +++ b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md @@ -0,0 +1,4 @@ +* **Use Memory Locking**: whether to lock the model in memory to prevent swapping. This can improve performance but requires enough available memory. +* **Use Memory Mapping**: whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled. +* **Load Vocabulary Only**: whether to only load the model vocabulary without the weights. Useful for testing tokenization. +* **Output Format**: specifies the format of the API response. Choose between **Default** and **JSON**. diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md index d2649e413..fa37a3b1f 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md @@ -25,25 +25,10 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama ## Node options -* **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. -* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to `-1` to disable. Valid range is between -1 and 100. -* **Top P**: chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions. Valid range is between 0 and 1. -* **Frequency Penalty**: adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition. Must be a non-negative number. -* **Keep Alive**: specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m (1 hour 30 minutes). -* **Low VRAM Mode**: whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory. -* **Main GPU ID**: specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs. -* **Context Batch Size**: sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage. -* **Context Length**: the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model. -* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to `-1` for auto-detection. -* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to `-1` for no limit. Be cautious when setting this to a large value, as it can lead to very long outputs. -* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to `0` for auto-detection. -* **Penalize Newlines**: whether the model will be less likely to generate newline characters, encouraging longer continuous sequences of text. -* **Presence Penalty**: adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity. +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md" * **Repetition Penalty**: adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to `1.0` to disable repetition penalty. -* **Use Memory Locking**: whether to lock the model in memory to prevent swapping. This can improve performance but requires sufficient available memory. -* **Use Memory Mapping**: whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled. -* **Load Vocabulary Only**: whether to only load the model vocabulary without the weights. Useful for quickly testing tokenization. -* **Output Format**: specifies the format of the API response. Choose between **Default** and **JSON**. +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md" + ## Related resources diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md index 4555b0a96..d15838d78 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md @@ -24,25 +24,8 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama ## Node options -* **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. -* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to -1 to disable. Valid range is between -1 and 100. -* **Top P**: chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions. Valid range is between 0 and 1. -* **Frequency Penalty**: adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition. Must be a non-negative number. -* **Keep Alive**: specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m (1 hour 30 minutes). -* **Low VRAM Mode**: whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory. -* **Main GPU ID**: specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs. -* **Context Batch Size**: sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage. -* **Context Length**: the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model. -* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to -1 for auto-detection. -* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to -1 for no limit. Be cautious when setting this to a large value, as it can lead to very long outputs. -* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to 0 for auto-detection. -* **Penalize Newlines**: whether the model will be less likely to generate newline characters, encouraging longer continuous sequences of text. -* **Presence Penalty**: adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity. -* **Repetition Penalty**: adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to 1.0 to disable repetition penalty. -* **Use Memory Locking**: whether to lock the model in memory to prevent swapping. This can improve performance but requires sufficient available memory. -* **Use Memory Mapping**: whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled. -* **Load Vocabulary Only**: whether to only load the model vocabulary without the weights. Useful for quickly testing tokenization. -* **Output Format**: specifies the format of the API response. Choose between 'Default' and 'JSON'. +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md" +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md" ## Related resources From 951e433f1dd3de965da42a9aff31f74482899098 Mon Sep 17 00:00:00 2001 From: Ria Scholz <123465523+mariaremote@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:07:46 +0200 Subject: [PATCH 05/12] Update docs/integrations/builtin/credentials/google/oauth-single-service.md Co-authored-by: Deborah --- .../builtin/credentials/google/oauth-single-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/builtin/credentials/google/oauth-single-service.md b/docs/integrations/builtin/credentials/google/oauth-single-service.md index 2f22e6bcf..61cfabd40 100644 --- a/docs/integrations/builtin/credentials/google/oauth-single-service.md +++ b/docs/integrations/builtin/credentials/google/oauth-single-service.md @@ -39,7 +39,7 @@ This document contains instructions for creating a Google credential for a singl ??? Details "View detailed steps" 1. Select **OAuth consent screen**. - 2. As **User Type**, select **Internal** for user access within your organisation's Google workspace or **External** for any user with a Google account. + 2. For **User Type**, select **Internal** for user access within your organization's Google workspace or **External** for any user with a Google account. 3. Select **Create**. 4. Enter the essential information: **App name**, **User support email**, and the **Email addresses** field in **Developer contact information**. 5. Add an authorized domain: select **+ ADD DOMAIN**. Enter `n8n.cloud` if using n8n's Cloud service, or the domain of your n8n instance if you're self-hosting. From 6d92c0d9f88e1a231c7db864072256aa2f88656d Mon Sep 17 00:00:00 2001 From: Ria Scholz <123465523+mariaremote@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:12:15 +0200 Subject: [PATCH 06/12] Update docs/integrations/builtin/credentials/google/oauth-single-service.md Co-authored-by: Deborah --- .../builtin/credentials/google/oauth-single-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/builtin/credentials/google/oauth-single-service.md b/docs/integrations/builtin/credentials/google/oauth-single-service.md index 61cfabd40..71c85e292 100644 --- a/docs/integrations/builtin/credentials/google/oauth-single-service.md +++ b/docs/integrations/builtin/credentials/google/oauth-single-service.md @@ -66,7 +66,7 @@ This document contains instructions for creating a Google credential for a singl 6. Select **CREATE**. 7. Enable each Google service API that you want to use: - 1. If using Google Perspective or Google Ads: [Request API Access for Perspective](https://developers.perspectiveapi.com/s/docs-get-started){:targe=_blank .external-link} or a [Developer Token for Ads](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:targe=_blank .external-link}. + 1. If using Google Perspective or Google Ads: [Request API Access for Perspective](https://developers.perspectiveapi.com/s/docs-get-started){:target=_blank .external-link} or a [Developer Token for Ads](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:target=_blank .external-link}. --8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md" ### Create and test your connection From ac54eadebcada03fc8c909d4c727ae20e6e917c1 Mon Sep 17 00:00:00 2001 From: Ria Scholz <123465523+mariaremote@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:14:16 +0200 Subject: [PATCH 07/12] Update oauth-generic.md fixing the target=blank --- .../builtin/credentials/google/oauth-generic.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/integrations/builtin/credentials/google/oauth-generic.md b/docs/integrations/builtin/credentials/google/oauth-generic.md index e4a7882a7..a40b223b7 100644 --- a/docs/integrations/builtin/credentials/google/oauth-generic.md +++ b/docs/integrations/builtin/credentials/google/oauth-generic.md @@ -11,11 +11,11 @@ This document contains instructions for creating a generic OAuth2 Google credent ## Prerequisites -* [Google Cloud](https://cloud.google.com/){:targe=_blank .external-link} account -* [Google Cloud Platform project](https://developers.google.com/workspace/marketplace/create-gcp-project){:targe=_blank .external-link} +* [Google Cloud](https://cloud.google.com/){:target=_blank .external-link} account +* [Google Cloud Platform project](https://developers.google.com/workspace/marketplace/create-gcp-project){:target=_blank .external-link} * If you haven't used OAuth in your Google Cloud project before, you need to [configure the OAuth consent screen](https://developers.google.com/workspace/guides/configure-oauth-consent){:target=_blank .external-link}. -* If using Google Perspective: [Request API Access](https://developers.perspectiveapi.com/s/docs-get-started){:targe=_blank .external-link} -* If using Google Ads: [Developer Token](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:targe=_blank .external-link} +* If using Google Perspective: [Request API Access](https://developers.perspectiveapi.com/s/docs-get-started){:target=_blank .external-link} +* If using Google Ads: [Developer Token](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:target=_blank .external-link} ## Set up OAuth From 0a83303428c2cbab58d79fdb456639cacf678e87 Mon Sep 17 00:00:00 2001 From: Ria Scholz <123465523+mariaremote@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:14:42 +0200 Subject: [PATCH 08/12] Update docs/integrations/builtin/credentials/google/oauth-generic.md Co-authored-by: Deborah --- docs/integrations/builtin/credentials/google/oauth-generic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/builtin/credentials/google/oauth-generic.md b/docs/integrations/builtin/credentials/google/oauth-generic.md index e8498141f..97c5213aa 100644 --- a/docs/integrations/builtin/credentials/google/oauth-generic.md +++ b/docs/integrations/builtin/credentials/google/oauth-generic.md @@ -50,7 +50,7 @@ This document contains instructions for creating a generic OAuth2 Google credent 5. Select **CREATE**. 6. Enable each Google service API that you want to use: - 1. If using Google Perspective or Google Ads: [Request API Access for Perspective](https://developers.perspectiveapi.com/s/docs-get-started){:targe=_blank .external-link} or a [Developer Token for Ads](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:targe=_blank .external-link}. + 1. If using Google Perspective or Google Ads: [Request API Access for Perspective](https://developers.perspectiveapi.com/s/docs-get-started){:target=_blank .external-link} or a [Developer Token for Ads](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:target=_blank .external-link}. --8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md" ### Create and test your connection From c83379971b3fda008782c0695948ddc33a1461b1 Mon Sep 17 00:00:00 2001 From: Ria Scholz <123465523+mariaremote@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:15:04 +0200 Subject: [PATCH 09/12] Update docs/integrations/builtin/credentials/google/oauth-generic.md Co-authored-by: Deborah --- docs/integrations/builtin/credentials/google/oauth-generic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/builtin/credentials/google/oauth-generic.md b/docs/integrations/builtin/credentials/google/oauth-generic.md index 97c5213aa..f004296ae 100644 --- a/docs/integrations/builtin/credentials/google/oauth-generic.md +++ b/docs/integrations/builtin/credentials/google/oauth-generic.md @@ -106,4 +106,4 @@ n8n doesn't support all scopes. When creating a generic Google OAuth2 API creden ### Google Cloud app becoming unauthorized -For Google Cloud apps with **Publishing status** set to **Testing** and **User type** set to **External**, consent and tokens expire after seven days. Refer to [Google Cloud Platform Console Help | Setting up your OAuth consent screen](https://support.google.com/cloud/answer/10311615?hl=en#zippy=%2Ctesting){:target=_blank .external-link} for more information. To resolve this, reconnect the app in the n8n credentials modal. \ No newline at end of file +For Google Cloud apps with **Publishing status** set to **Testing**, and **User type** set to **External**, consent and tokens expire after seven days. Refer to [Google Cloud Platform Console Help | Setting up your OAuth consent screen](https://support.google.com/cloud/answer/10311615?hl=en#zippy=%2Ctesting){:target=_blank .external-link} for more information. To resolve this, reconnect the app in the n8n credentials modal. \ No newline at end of file From e579d8666ec65ef6a8d315290a75842c332e1f9f Mon Sep 17 00:00:00 2001 From: Deborah Date: Tue, 30 Apr 2024 09:26:45 +0100 Subject: [PATCH 10/12] Revert "Update Ollama chat + lm options docs" --- .../langchain-sub-nodes/ollama-options-1.md | 14 -------------- .../langchain-sub-nodes/ollama-options-2.md | 4 ---- .../sub-nodes/n8n-nodes-langchain.lmchatollama.md | 13 ++++++++----- .../sub-nodes/n8n-nodes-langchain.lmollama.md | 12 +++++++++--- 4 files changed, 17 insertions(+), 26 deletions(-) delete mode 100644 _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md delete mode 100644 _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md diff --git a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md deleted file mode 100644 index be67d0cd1..000000000 --- a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md +++ /dev/null @@ -1,14 +0,0 @@ -* **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. -* **Top K**: limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to `-1` to disable. Valid range is between -1 and 100. -* **Top P**: chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions. Valid range is between 0 and 1. -* **Frequency Penalty**: adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition. Must be a non-negative number. -* **Keep Alive**: specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m (1 hour 30 minutes). -* **Low VRAM Mode**: whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory. -* **Main GPU ID**: specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs. -* **Context Batch Size**: sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage. -* **Context Length**: the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model. -* **Number of GPUs**: specifies the number of GPUs to use for parallel processing. Set to `-1` for autodetection. -* **Max Tokens to Generate**: the maximum number of tokens to generate. Set to `-1` for no limit. Be cautious when setting this to a large value, as it can lead to long outputs. -* **Number of CPU Threads**: specifies the number of CPU threads to use for processing. Set to `0` for autodetection. -* **Penalize Newlines**: reduce the chances of the model generating newline characters, encouraging longer continuous sequences of text. -* **Presence Penalty**: adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity. diff --git a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md deleted file mode 100644 index 22541b2de..000000000 --- a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md +++ /dev/null @@ -1,4 +0,0 @@ -* **Use Memory Locking**: whether to lock the model in memory to prevent swapping. This can improve performance but requires enough available memory. -* **Use Memory Mapping**: whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled. -* **Load Vocabulary Only**: whether to only load the model vocabulary without the weights. Useful for testing tokenization. -* **Output Format**: specifies the format of the API response. Choose between **Default** and **JSON**. diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md index fa37a3b1f..4a5c15b60 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md @@ -21,14 +21,17 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama ## Node parameters -* **Model**: the model that generates the completion. The models options are fetched from the Ollama API running on the provided credential URL. +* **Model**: the model that generates the completion. Choose from: + * Llama2 + * Llama2 13B + * Llama2 70B + * Llama2 Uncensored ## Node options ---8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md" -* **Repetition Penalty**: adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to `1.0` to disable repetition penalty. ---8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md" - +* **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. +* **Top K**: the number of token choices the model uses to generate the next token. +* **Top P**: use a lower value to ignore less probable options. ## Related resources diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md index d15838d78..b56c1e978 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmollama.md @@ -20,12 +20,18 @@ For usage examples and templates to help you get started, refer to n8n's [Ollama ## Node parameters -* **Model**: the model that generates the completion. The models options are fetched from the Ollama API running on the provided credential URL. +* **Model**: the model that generates the completion. Choose from: + * Llama2 + * Llama2 13B + * Llama2 70B + * Llama2 Uncensored ## Node options ---8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-1.md" ---8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/ollama-options-2.md" +* **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations. +* **Top K**: the number of token choices the model uses to generate the next token. +* **Top P**: use a lower value to ignore less probable options. + ## Related resources From 27a88bd83ad11de9f7d28a85b698ac7532b8ec36 Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Tue, 30 Apr 2024 13:30:05 +0100 Subject: [PATCH 11/12] remove instant nav and see if it helps with footer issues and unresponsive anchor links --- mkdocs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index a24c4600b..77adf1e39 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,8 +38,6 @@ theme: - navigation.footer # https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#section-index-pages - navigation.indexes - # https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#instant-loading - - navigation.instant # https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-path - navigation.path # https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-sections From 667267bb79492ee036621a48a1ef0c8f1f7d9333 Mon Sep 17 00:00:00 2001 From: Maria <123465523+mariaremote@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:02:09 +0200 Subject: [PATCH 12/12] added snippet for google oauth docs --- .../builtin/credentials/google/app-becoming-unauthorized.md | 1 + docs/integrations/builtin/credentials/google/oauth-generic.md | 2 +- .../builtin/credentials/google/oauth-single-service.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 _snippets/integrations/builtin/credentials/google/app-becoming-unauthorized.md diff --git a/_snippets/integrations/builtin/credentials/google/app-becoming-unauthorized.md b/_snippets/integrations/builtin/credentials/google/app-becoming-unauthorized.md new file mode 100644 index 000000000..9933ff721 --- /dev/null +++ b/_snippets/integrations/builtin/credentials/google/app-becoming-unauthorized.md @@ -0,0 +1 @@ +For Google Cloud apps with **Publishing status** set to **Testing** and **User type** set to **External**, consent and tokens expire after seven days. Refer to [Google Cloud Platform Console Help | Setting up your OAuth consent screen](https://support.google.com/cloud/answer/10311615?hl=en#zippy=%2Ctesting){:target=_blank .external-link} for more information. To resolve this, reconnect the app in the n8n credentials modal. \ No newline at end of file diff --git a/docs/integrations/builtin/credentials/google/oauth-generic.md b/docs/integrations/builtin/credentials/google/oauth-generic.md index e8498141f..a504a494e 100644 --- a/docs/integrations/builtin/credentials/google/oauth-generic.md +++ b/docs/integrations/builtin/credentials/google/oauth-generic.md @@ -106,4 +106,4 @@ n8n doesn't support all scopes. When creating a generic Google OAuth2 API creden ### Google Cloud app becoming unauthorized -For Google Cloud apps with **Publishing status** set to **Testing** and **User type** set to **External**, consent and tokens expire after seven days. Refer to [Google Cloud Platform Console Help | Setting up your OAuth consent screen](https://support.google.com/cloud/answer/10311615?hl=en#zippy=%2Ctesting){:target=_blank .external-link} for more information. To resolve this, reconnect the app in the n8n credentials modal. \ No newline at end of file +--8<-- "_snippets/integrations/builtin/credentials/google/app-becoming-unauthorized.md" \ No newline at end of file diff --git a/docs/integrations/builtin/credentials/google/oauth-single-service.md b/docs/integrations/builtin/credentials/google/oauth-single-service.md index 2f22e6bcf..1e6f58e6a 100644 --- a/docs/integrations/builtin/credentials/google/oauth-single-service.md +++ b/docs/integrations/builtin/credentials/google/oauth-single-service.md @@ -91,5 +91,5 @@ In n8n: ### Google Cloud app becoming unauthorized -For Google Cloud apps with **Publishing status** set to **Testing** and **User type** set to **External**, consent and tokens expire after seven days. Refer to [Google Cloud Platform Console Help | Setting up your OAuth consent screen](https://support.google.com/cloud/answer/10311615?hl=en#zippy=%2Ctesting){:target=_blank .external-link} for more information. To resolve this, reconnect the app in the n8n credentials modal. +--8<-- "_snippets/integrations/builtin/credentials/google/app-becoming-unauthorized.md"