From dc639a37d136f321f086f8b00efccc1d46675757 Mon Sep 17 00:00:00 2001 From: rakeshjosh2003 <102702631+rakeshjosh2003@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:34:21 +1100 Subject: [PATCH 1/4] Update faq.mdx --- docs/cody/faq.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/cody/faq.mdx b/docs/cody/faq.mdx index fee3d1dff..b019a35d5 100644 --- a/docs/cody/faq.mdx +++ b/docs/cody/faq.mdx @@ -137,6 +137,19 @@ cody chat --model '$name_of_the_model' -m 'Hi Cody!' For example, to use Claude 3.5 Sonnet, you'd pass the following command in your terminal, `cody chat --model 'claude-3.5-sonnet' -m 'Hi Cody!' +### Is it possible to set separate token usage just for programmatic access( via API) and not to be used via IDE? + +Yes, it's possible to set separate token usage for API but only for completions (not chat). To achieve this you need to use the custom [model configuration](https://sourcegraph.com/docs/cody/enterprise/model-configuration#model-overrides). You need to configure the below settings + + maxInputTokens: Specifies the maximum number of tokens for the contextual data in the prompt (e.g., question, relevant snippets + + maxOutputTokens: Specifies the maximum number of tokens allowed in the response + +Also, remove the below setting in the site configuration under the model configuration. + + "capabilities": ["autocomplete", "chat"] + + ## OpenAI o1 ### What are OpenAI o1 best practices? From eb0d23af1d1c680ae3a1798861f425b40faa08b1 Mon Sep 17 00:00:00 2001 From: rakeshjosh2003 <102702631+rakeshjosh2003@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:54:14 +1100 Subject: [PATCH 2/4] Update Cody faq page. --- docs/cody/faq.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cody/faq.mdx b/docs/cody/faq.mdx index b019a35d5..b81796515 100644 --- a/docs/cody/faq.mdx +++ b/docs/cody/faq.mdx @@ -145,9 +145,9 @@ Yes, it's possible to set separate token usage for API but only for completions maxOutputTokens: Specifies the maximum number of tokens allowed in the response -Also, remove the below setting in the site configuration under the model configuration. +Also, you need to set the "capabilities" list as empty in the model configuration. - "capabilities": ["autocomplete", "chat"] + "capabilities": [] ## OpenAI o1 From eef9d30bf934ab77ea9d5c2385862b55ae4b9c95 Mon Sep 17 00:00:00 2001 From: rakeshjosh2003 <102702631+rakeshjosh2003@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:32:55 +1100 Subject: [PATCH 3/4] Update faq.mdx --- docs/cody/faq.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cody/faq.mdx b/docs/cody/faq.mdx index b81796515..a2e3dfc7b 100644 --- a/docs/cody/faq.mdx +++ b/docs/cody/faq.mdx @@ -139,7 +139,7 @@ For example, to use Claude 3.5 Sonnet, you'd pass the following command in your ### Is it possible to set separate token usage just for programmatic access( via API) and not to be used via IDE? -Yes, it's possible to set separate token usage for API but only for completions (not chat). To achieve this you need to use the custom [model configuration](https://sourcegraph.com/docs/cody/enterprise/model-configuration#model-overrides). You need to configure the below settings +Yes, it's possible to configure a custom context window exclusively for programmatic access via the API. To achieve this you need to use the custom [model configuration](https://sourcegraph.com/docs/cody/enterprise/model-configuration#model-overrides). You need to configure the below settings maxInputTokens: Specifies the maximum number of tokens for the contextual data in the prompt (e.g., question, relevant snippets From 149a8d05a877c483e0f04e2996cd7d23c2176ab0 Mon Sep 17 00:00:00 2001 From: rakeshjosh2003 <102702631+rakeshjosh2003@users.noreply.github.com> Date: Thu, 16 Jan 2025 15:04:09 +1100 Subject: [PATCH 4/4] Update faq.mdx --- docs/cody/faq.mdx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/cody/faq.mdx b/docs/cody/faq.mdx index a2e3dfc7b..fd701e497 100644 --- a/docs/cody/faq.mdx +++ b/docs/cody/faq.mdx @@ -137,18 +137,20 @@ cody chat --model '$name_of_the_model' -m 'Hi Cody!' For example, to use Claude 3.5 Sonnet, you'd pass the following command in your terminal, `cody chat --model 'claude-3.5-sonnet' -m 'Hi Cody!' -### Is it possible to set separate token usage just for programmatic access( via API) and not to be used via IDE? +### Can I configure custom context windows for API-only access? -Yes, it's possible to configure a custom context window exclusively for programmatic access via the API. To achieve this you need to use the custom [model configuration](https://sourcegraph.com/docs/cody/enterprise/model-configuration#model-overrides). You need to configure the below settings +Yes, it's possible to configure a custom context window exclusively for programmatic access via the API. To achieve this you need to use the custom [model configuration](https://sourcegraph.com/docs/cody/enterprise/model-configuration#model-overrides) and set the "capabilities" list as empty in the model configuration. - maxInputTokens: Specifies the maximum number of tokens for the contextual data in the prompt (e.g., question, relevant snippets - - maxOutputTokens: Specifies the maximum number of tokens allowed in the response - -Also, you need to set the "capabilities" list as empty in the model configuration. - - "capabilities": [] +Here's an example config + "contextWindow": { + // Specifies the maximum number of tokens for the contextual data in the prompt (e.g., question, relevant snippets) + "maxInputTokens": 45000, + // Specifies the maximum number of tokens allowed in the response + "maxOutputTokens": 8000 + }, + // Set the "capabilities" list as empty to ensure the model is not available on Cody Web or IDEs + "capabilities": [], ## OpenAI o1