Skip to content
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
b4169f2
wip
taras-yemets Oct 28, 2024
131e030
Merge branch 'main' into ty/modelconfig
taras-yemets Oct 28, 2024
f651e4f
wip
taras-yemets Oct 28, 2024
8d56a3b
Merge remote-tracking branch 'origin/ty/modelconfig' into ty/modelconfig
taras-yemets Oct 28, 2024
f453374
wip
taras-yemets Oct 28, 2024
44bf2d9
revert changes
taras-yemets Oct 29, 2024
63274ec
wip
taras-yemets Oct 29, 2024
0b6962c
wip
taras-yemets Oct 30, 2024
9d4c5b0
Merge branch 'main' into ty/modelconfig
taras-yemets Oct 30, 2024
cb0fa6a
wip
taras-yemets Oct 30, 2024
c7c9073
Merge remote-tracking branch 'origin/ty/modelconfig' into ty/modelconfig
taras-yemets Oct 30, 2024
a9f7f4c
wip
taras-yemets Oct 31, 2024
d935f69
wip
taras-yemets Oct 31, 2024
90ac8d0
wip
taras-yemets Oct 31, 2024
1467b00
wip
taras-yemets Oct 31, 2024
3551c9d
wip
taras-yemets Nov 4, 2024
be6f553
wip
taras-yemets Nov 4, 2024
f6a58b0
wip
taras-yemets Nov 4, 2024
fb2e71b
rm "edit" capability mentions
taras-yemets Nov 4, 2024
e716b9c
Update docs/cody/model-configuration/examples.mdx
taras-yemets Nov 8, 2024
d25fdfc
Update docs/cody/model-configuration/examples.mdx
taras-yemets Nov 8, 2024
a881d5f
upd copy
taras-yemets Nov 20, 2024
7862b6c
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets Nov 20, 2024
e4977a2
Resolve conflicts
MaedahBatool Nov 21, 2024
b01326b
Add nav items
MaedahBatool Nov 21, 2024
24add92
Merge branch 'main' into ty/modelconfig
MaedahBatool Nov 21, 2024
76213c5
Resolve merge conflicts
MaedahBatool Nov 21, 2024
9b33ea1
remove Google Vertex (public) example
taras-yemets Nov 21, 2024
14e375b
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets Nov 21, 2024
bf4ac99
First draft still working
MaedahBatool Nov 21, 2024
8ace100
Rmv model config matrix
MaedahBatool Nov 21, 2024
b680cf5
Add improvements
MaedahBatool Nov 22, 2024
e6c2576
Add examples
MaedahBatool Nov 22, 2024
237d732
Add links and hash links
MaedahBatool Nov 22, 2024
b6669b3
Add note for missing code
MaedahBatool Nov 22, 2024
09bf462
Merge branch 'main' into ty/modelconfig
MaedahBatool Nov 22, 2024
af56933
add missing example
taras-yemets Nov 22, 2024
91da74b
add note on azure openai models
taras-yemets Nov 22, 2024
e893b3c
fix formatting
taras-yemets Nov 22, 2024
097bfc2
fix
taras-yemets Nov 22, 2024
f21997f
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets Nov 22, 2024
67cddad
address feedback
taras-yemets Nov 22, 2024
523ba07
fix
taras-yemets Nov 22, 2024
3b22db8
upd
taras-yemets Nov 22, 2024
78aae4c
change examples order
taras-yemets Nov 22, 2024
db4f562
Update docs/cody/enterprise/model-configuration.mdx
taras-yemets Nov 22, 2024
50ea693
change section order
taras-yemets Nov 22, 2024
bca37cc
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets Nov 22, 2024
1bceb58
Update docs/cody/enterprise/model-configuration.mdx
taras-yemets Nov 22, 2024
e9e7af6
Update docs/cody/enterprise/model-configuration.mdx
taras-yemets Nov 22, 2024
4477219
upd comment
taras-yemets Nov 23, 2024
a7d4290
address feedback
taras-yemets Nov 23, 2024
9e47078
fix formatting
taras-yemets Nov 23, 2024
ddc090c
aws => amazon bedrock
taras-yemets Nov 23, 2024
9c08f89
remove duplication
taras-yemets Nov 23, 2024
bb76873
remove model tier mentions
taras-yemets Nov 23, 2024
ec11370
upd comment
taras-yemets Nov 25, 2024
ed191ef
Update docs/cody/enterprise/features.mdx
taras-yemets Nov 25, 2024
03c9d6d
Update docs/cody/enterprise/completions-configuration.mdx
taras-yemets Nov 25, 2024
8a280f7
Update docs/cody/clients/enable-cody-enterprise.mdx
taras-yemets Nov 25, 2024
324868b
Update docs/cody/enterprise/completions-configuration.mdx
taras-yemets Nov 25, 2024
b1f1b9f
upd amazon bedrock example and docs
taras-yemets Nov 25, 2024
56cd4b8
Merge branch 'ty/modelconfig' of github.com:sourcegraph/docs into ty/…
taras-yemets Nov 25, 2024
1033347
fix default model field name
taras-yemets Nov 25, 2024
6b11a52
remove self-hosted models
taras-yemets Nov 25, 2024
891ff0a
Merge branch 'main' into ty/modelconfig
Nov 25, 2024
bb313f0
Update src/data/navigation.ts
MaedahBatool Nov 25, 2024
bbe8279
Update docs/cody/enterprise/features.mdx
MaedahBatool Nov 25, 2024
3471de4
fix build errors
MaedahBatool Nov 25, 2024
aa709dd
prompt pre-instructions docs
MaedahBatool Nov 25, 2024
eadab3a
Rmv duplicate folder
MaedahBatool Nov 25, 2024
fead11d
Merge branch 'sg-next-nov25' into ty/modelconfig
MaedahBatool Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 75 additions & 57 deletions docs/cody/clients/enable-cody-enterprise.mdx
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

![ide-token-expiry](https://storage.googleapis.com/sourcegraph-assets/Docs/token-expiry.png)
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

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
How to enable Cody only for _some_ users depends on what version of Sourcegraph you are running.

### 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:

![@-mention-directory](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-ent-at-mention-dir-1124.png)
- 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
![add-overrides](https://user-images.githubusercontent.com/25070988/235454594-9f1a6b27-6882-44d9-be32-258d6c244880.png)

### 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>
Loading