-
Notifications
You must be signed in to change notification settings - Fork 72
Add modelConfig docs #735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add modelConfig docs #735
Changes from 56 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
b4169f2
wip
taras-yemets 131e030
Merge branch 'main' into ty/modelconfig
taras-yemets f651e4f
wip
taras-yemets 8d56a3b
Merge remote-tracking branch 'origin/ty/modelconfig' into ty/modelconfig
taras-yemets f453374
wip
taras-yemets 44bf2d9
revert changes
taras-yemets 63274ec
wip
taras-yemets 0b6962c
wip
taras-yemets 9d4c5b0
Merge branch 'main' into ty/modelconfig
taras-yemets cb0fa6a
wip
taras-yemets c7c9073
Merge remote-tracking branch 'origin/ty/modelconfig' into ty/modelconfig
taras-yemets a9f7f4c
wip
taras-yemets d935f69
wip
taras-yemets 90ac8d0
wip
taras-yemets 1467b00
wip
taras-yemets 3551c9d
wip
taras-yemets be6f553
wip
taras-yemets f6a58b0
wip
taras-yemets fb2e71b
rm "edit" capability mentions
taras-yemets e716b9c
Update docs/cody/model-configuration/examples.mdx
taras-yemets d25fdfc
Update docs/cody/model-configuration/examples.mdx
taras-yemets a881d5f
upd copy
taras-yemets 7862b6c
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets e4977a2
Resolve conflicts
MaedahBatool b01326b
Add nav items
MaedahBatool 24add92
Merge branch 'main' into ty/modelconfig
MaedahBatool 76213c5
Resolve merge conflicts
MaedahBatool 9b33ea1
remove Google Vertex (public) example
taras-yemets 14e375b
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets bf4ac99
First draft still working
MaedahBatool 8ace100
Rmv model config matrix
MaedahBatool b680cf5
Add improvements
MaedahBatool e6c2576
Add examples
MaedahBatool 237d732
Add links and hash links
MaedahBatool b6669b3
Add note for missing code
MaedahBatool 09bf462
Merge branch 'main' into ty/modelconfig
MaedahBatool af56933
add missing example
taras-yemets 91da74b
add note on azure openai models
taras-yemets e893b3c
fix formatting
taras-yemets 097bfc2
fix
taras-yemets f21997f
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets 67cddad
address feedback
taras-yemets 523ba07
fix
taras-yemets 3b22db8
upd
taras-yemets 78aae4c
change examples order
taras-yemets db4f562
Update docs/cody/enterprise/model-configuration.mdx
taras-yemets 50ea693
change section order
taras-yemets bca37cc
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets 1bceb58
Update docs/cody/enterprise/model-configuration.mdx
taras-yemets e9e7af6
Update docs/cody/enterprise/model-configuration.mdx
taras-yemets 4477219
upd comment
taras-yemets a7d4290
address feedback
taras-yemets 9e47078
fix formatting
taras-yemets ddc090c
aws => amazon bedrock
taras-yemets 9c08f89
remove duplication
taras-yemets bb76873
remove model tier mentions
taras-yemets ec11370
upd comment
taras-yemets ed191ef
Update docs/cody/enterprise/features.mdx
taras-yemets 03c9d6d
Update docs/cody/enterprise/completions-configuration.mdx
taras-yemets 8a280f7
Update docs/cody/clients/enable-cody-enterprise.mdx
taras-yemets 324868b
Update docs/cody/enterprise/completions-configuration.mdx
taras-yemets b1f1b9f
upd amazon bedrock example and docs
taras-yemets 56cd4b8
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets 1033347
fix default model field name
taras-yemets 6b11a52
remove self-hosted models
taras-yemets 891ff0a
Merge branch 'main' into ty/modelconfig
bb313f0
Update src/data/navigation.ts
MaedahBatool bbe8279
Update docs/cody/enterprise/features.mdx
MaedahBatool 3471de4
fix build errors
MaedahBatool aa709dd
prompt pre-instructions docs
MaedahBatool eadab3a
Rmv duplicate folder
MaedahBatool fead11d
Merge branch 'sg-next-nov25' into ty/modelconfig
MaedahBatool File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,119 @@ | ||
# Cody on Sourcegraph Enterprise | ||
# Cody for Enterprise | ||
|
||
<p className="subtitle">Cody enhances your coding experience by providing intelligent code suggestions, context-aware completions, and advanced code analysis. These docs will help you use Cody on your Sourcegraph Enterprise instance.</p> | ||
|
||
<LinkCards> | ||
<LinkCard href="https://sourcegraph.com/contact/request-info" imgSrc="https://sourcegraph.com/.assets/img/sourcegraph-mark.svg" imgAlt="Cody Enterprise" title="Cody Enterprise" description="Get in touch with our team to try Cody for Sourcegraph Enterprise." /> | ||
</LinkCards> | ||
|
||
## Cody Enterprise features | ||
## Setting up Cody Enterprise | ||
|
||
To cater to your Enterprise requirements, Cody offers the following features: | ||
You can set up Cody for your Enterprise instance by two methods: | ||
|
||
### IDE token expiry | ||
1. Sourcegraph Cloud | ||
2. Self-hosted Sourcegraph | ||
|
||
Site administrators can set the duration of access tokens for users connecting Cody from their IDEs (VS Code, JetBrains, etc.). This can be configured from the **Site admin** page of the Sourcegraph Enterprise instance. Available options include **7, 14, 30, 60, and 90 days**. | ||
## Cody on Sourcegraph Cloud | ||
|
||
 | ||
With [Sourcegraph Cloud](/cloud/), you get Cody as a managed service, and you **do not** need to enable Cody as is required for self-hosted setup. However, by contacting your account manager, Cody can still be enabled or disabled on-demand on your Sourcegraph instance. | ||
|
||
### Guardrails | ||
## Self-hosted Sourcegraph Enterprise | ||
|
||
<Callout type= "note">Guardrails for public code is currently in Beta and is supported with VS Code and JetBrains IDEs extensions.</Callout> | ||
### Prerequisites | ||
|
||
Open source attribution guardrails for public code, commonly called copyright guardrails, reduce the exposure to copyrighted code. This involves implementing a verification mechanism within Cody to ensure that any code generated by the platform does not replicate open source code. | ||
- You have Sourcegraph version `5.1.0` or more | ||
- A Sourcegraph Enterprise subscription with [Cody Gateway](/cody/core-concepts/cody-gateway) or an account with a third-party LLM provider | ||
|
||
Guardrails for public code are available to all Sourcegraph Enterprise instances and are **disabled** by default. You can enable them from the Site configuration section by setting `attribution.enabled` to `true`. | ||
### Enable Cody on your Sourcegraph instance | ||
|
||
Guardrails don't differentiate between license types. It matches any code snippet that is at least **ten lines** long from the **290,000** indexed open source repositories. | ||
Site admins can only enable Cody on the Sourcegraph instance. To do so, | ||
|
||
### Admin controls | ||
- First, configure your desired LLM provider either by [using Sourcegraph Cody Gateway](/cody/core-concepts/cody-gateway) (recommended) or by directly using a third-party LLM provider | ||
- Next, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: | ||
|
||
<Callout type="note">Admin controls are supported with VS Code and JetBrains IDE extension.</Callout> | ||
```json | ||
{ | ||
// [...] | ||
"cody.enabled": true, | ||
"completions": { | ||
"provider": "sourcegraph" | ||
} | ||
} | ||
``` | ||
|
||
Site administrators have selective control over users' access to Cody Enterprise, which is managed via the Sourcegraph role-based access control system. This provides a more intuitive user interface for assigning permission to use Cody. | ||
- Cody is enabled on your self-hosted Sourcegraph enterprise instance | ||
|
||
### Analytics | ||
## Disable Cody | ||
|
||
<Callout type= "note">Cody Analytics are supported with VS Code IDE extension and on the latest versions of JetBrains IDEs.</Callout> | ||
To turn Cody off: | ||
|
||
Cody Enterprise users can view analytics for their instance. A separately managed cloud service for Cody analytics handles user auth, gets metrics data from Sourcegraph's BigQuery instance, and visualizes the metrics data. | ||
- Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: | ||
|
||
The following metrics are available for Cody Enterprise users: | ||
```json | ||
{ | ||
// [...] | ||
"cody.enabled": false | ||
} | ||
``` | ||
|
||
| **Metric Type** | **What is measured?** | | ||
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| Active users | - Total active users <br /> - Average daily users <br /> - Average no. of days each user used Cody (of last 30 days) <br /> - Cody users by day (last 30 days) <br /> - Cody users by month (last two months) <br /> - Cody users by number of days used | | ||
| Completions | - Total accepted completions <br /> - Minutes saved per completion <br /> - Hours saved by completions <br /> - Cody completions by day <br /> - Completions acceptance rate <br /> - Weighted completions acceptance rate <br /> - Average completion latency <br /> - Acceptance rate by language <br /> | | ||
| Chat | - Total chat events <br /> - Minutes saved per chat <br /> - Hours saved by chats <br /> - Cody chats by day | | ||
| Commands | - Total command events <br /> - Minutes saved per command <br /> - Hours saved by commands <br /> - Cody commands by day <br /> - Most used commands | | ||
- Next, remove `completions` configuration if they exist | ||
MaedahBatool marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
To enable Cody Analytics: | ||
## Enable Cody only for some users | ||
|
||
- Create an account on [Sourcegraph Accounts](https://accounts.sourcegraph.com/) | ||
- A user already having a Sourcegraph.com account gets automatically migrated to Sourcegraph Accounts. Users can sign in to Cody Analytics using their email and password | ||
- Users without a Sourcegraph.com account should contact one of our team members. They can help with both the account setup and assigning instances to specific users | ||
- Map your user account to a Sourcegraph instance, and this gives you access to Cody analytics | ||
To enable Cody only for some users it depends on what version of Sourcegraph you are running. | ||
taras-yemets marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
### Multi-repository context | ||
### Sourcegraph v5.3+ | ||
|
||
Cody supports multi-repository context, allowing you to search up to 10 repositories simultaneously for relevant information. Open a new chat, type `@`, and select `Remote Repositories.` | ||
In Sourcegraph v5.3+, access to Cody is managed via user roles. By default, all users have access. | ||
|
||
Keep @-mentioning repos that you want to include in your context. This flexibility lets you get more comprehensive and accurate responses by leveraging information across multiple codebases. | ||
First, ensure Cody is enabled in your site configuration. Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: | ||
|
||
### @-mention directory | ||
```json | ||
{ | ||
// [...] | ||
"cody.enabled": true, | ||
// Make sure cody.restrictUsersFeatureFlag is not in your configuration! If it is, remove it. | ||
} | ||
``` | ||
|
||
To better support teams working with large monorepos, Enterprise users can `@-mention` directories when chatting with Cody. This helps you define more specific directories and sub-directories within that monorepo to give more precise context. | ||
<Callout type="info"> Ensure `cody.restrictUsersFeatureFlag` is **not** in your site configuration. If it is, remove it or else the old feature-flag approach from Sourcegraph 5.2 and earlier will be used.</Callout> | ||
|
||
To do this, type `@` in the chat, and then select **Directories** to search other repositories for context in your codebase. | ||
Next, go to **Site admin > Users & Auth > Roles** (`/site-admin/roles`) on your instance. On that page, you can: | ||
|
||
 | ||
- Control whether users **by default** have access to Cody (expand `User [System]` and toggle **Cody** > **Access** as desired) | ||
- Control whether groups of users have access to Cody (`+Create role` and enable the **Cody** > **Access** toggle as desired) | ||
|
||
Please note that you can only `@-mention` remote directories (i.e., directories in your Sourcegraph instance) but not local directories. This means any recent changes to your directories can't be utilized as context until your Sourcegraph instance re-indexes any changes. | ||
### Sourcegraph v5.2 and earlier | ||
|
||
If you want to include recent changes that haven't been indexed in your Sourcegraph instance, you can `@-mention` specific files, lines of code, or symbols. | ||
In Sourcegraph v5.2 and earlier, you should use the feature flag `cody` to turn Cody on selectively for some users. To do so: | ||
|
||
## Supported LLM models | ||
- Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: | ||
|
||
Sourcegraph Enterprise supports different LLM providers and models, such as models from Anthropic and OpenAI. You can do this by adjusting your Sourcegraph instance configuration. | ||
```json | ||
{ | ||
// [...] | ||
"cody.enabled": true, | ||
"cody.restrictUsersFeatureFlag": true | ||
} | ||
``` | ||
|
||
<FeatureParity type='ent' /> | ||
For the supported LLM models listed above, refer to the following notes: | ||
- Next, go to **Site admin > Feature flags** (`/site-admin/feature-flags`) | ||
- Add a feature flag called `cody` | ||
- Select the `boolean` type and set it to `false` | ||
- Once added, click on the feature flag and use **add overrides** to pick users that will have access to Cody | ||
|
||
1. Microsoft Azure is planning to deprecate the APIs used in Sourcegraph version `>5.3.3` on July 1, 2024 [Source](https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation) | ||
2. Claude 2.1 is not recommended | ||
3. Sourcegraph doesn’t recommend using the GPT-4 (non-Turbo), Claude 1, or Claude 2 models anymore | ||
4. Only supported through legacy completions API | ||
5. BYOK (Bring Your Own Key) with managed services are only supported for Self-hosted Sourcegraph instances | ||
6. GPT-4 and GPT-4o for completions have a bug that is resulting in many failed completions | ||
 | ||
|
||
### Supported model configuration | ||
## Configure Cody for LLM providers | ||
|
||
Use the drop-down menu to make your desired selection and get a detailed breakdown of the supported model configuration for each provider on Cody Enterprise. This is an on-site configuration. Admins should pick a value from the table for `chatModel` to configure their chat model. | ||
Cody supports several LLM providers and models. You can access these models via the Cody Gateway, directly using your own model provider account or infrastructure. | ||
|
||
<FeatureParity type='configuration' /> | ||
There are two ways of configuring Cody for LLM providers: | ||
|
||
For the supported LLM model configuration listed above, refer to the following notes: | ||
<QuickLinks> | ||
|
||
1. Microsoft Azure is planning to deprecate the APIs used in Sourcegraph version `>5.3.3` on July 1, 2024 [Source](https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation) | ||
2. Claude 2.1 is not recommended | ||
3. Sourcegraph doesn't recommend GPT-4 non-turbo, Claude 1 or 2 models | ||
4. Only supported through legacy completions API | ||
5. BYOK (Bring Your Own Key) with managed services are only supported for Self-hosted Sourcegraph instances | ||
<QuickLink title="Completions" icon='lightbulb' href="/cody/enterprise/completions-configuration" description="How to configure Cody using the completions." /> | ||
|
||
<QuickLink title="Model Configuration" icon='installation' href="/cody/enterprise/model-configuration" description="How to configure Cody using the model configuration." /> | ||
|
||
</QuickLinks> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.