Skip to content

Commit bf4ac99

Browse files
committed
First draft still working
1 parent 14e375b commit bf4ac99

File tree

7 files changed

+374
-622
lines changed

7 files changed

+374
-622
lines changed
Lines changed: 75 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,119 @@
1-
# Cody on Sourcegraph Enterprise
1+
# Cody for Enterprise
22

33
<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>
44

55
<LinkCards>
66
<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." />
77
</LinkCards>
88

9-
## Cody Enterprise features
9+
## Setting up Cody Enterprise
1010

11-
To cater to your Enterprise requirements, Cody offers the following features:
11+
You can set up Cody for your Enterprise instance by two methods:
1212

13-
### IDE token expiry
13+
1. [Sourcegraph Cloud](#cody-on-sourcegraph-cloud)
14+
2. [Self-hosted Sourcegraph](#cody-on-self-hosted-sourcegraph-enterprise)
1415

15-
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**.
16+
## Cody on Sourcegraph Cloud
1617

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

19-
### Guardrails
20+
## Self-hosted Sourcegraph Enterprise
2021

21-
<Callout type= "note">Guardrails for public code is currently in Beta and is supported with VS Code and JetBrains IDEs extensions.</Callout>
22+
### Prerequisites
2223

23-
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.
24+
- You have Sourcegraph version `5.1.0` or more
25+
- A Sourcegraph Enterprise subscription with [Cody Gateway](/cody/core-concepts/cody-gateway) or an account with a third-party LLM provider
2426

25-
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`.
27+
### Enable Cody on your Sourcegraph instance
2628

27-
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.
29+
Site admins can only enable Cody on the Sourcegraph instance. To do so,
2830

29-
### Admin controls
31+
- 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
32+
- Next, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set:
3033

31-
<Callout type="note">Admin controls are supported with VS Code and JetBrains IDE extension.</Callout>
34+
```json
35+
{
36+
// [...]
37+
"cody.enabled": true,
38+
"completions": {
39+
"provider": "sourcegraph"
40+
}
41+
}
42+
```
3243

33-
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.
44+
- Cody is enabled on your self-hosted Sourcegraph enterprise instance
3445

35-
### Analytics
46+
## Disable Cody
3647

37-
<Callout type= "note">Cody Analytics are supported with VS Code IDE extension and on the latest versions of JetBrains IDEs.</Callout>
48+
To turn Cody off:
3849

39-
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.
50+
- Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set:
4051

41-
The following metrics are available for Cody Enterprise users:
52+
```json
53+
{
54+
// [...]
55+
"cody.enabled": false
56+
}
57+
```
4258

43-
| **Metric Type** | **What is measured?** |
44-
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45-
| 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 |
46-
| 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 /> |
47-
| Chat | - Total chat events <br /> - Minutes saved per chat <br /> - Hours saved by chats <br /> - Cody chats by day |
48-
| Commands | - Total command events <br /> - Minutes saved per command <br /> - Hours saved by commands <br /> - Cody commands by day <br /> - Most used commands |
59+
- Next, remove `completions` configuration if they exist
4960

50-
To enable Cody Analytics:
61+
## Enable Cody only for some users
5162

52-
- Create an account on [Sourcegraph Accounts](https://accounts.sourcegraph.com/)
53-
- 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
54-
- 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
55-
- Map your user account to a Sourcegraph instance, and this gives you access to Cody analytics
63+
To enable Cody only for some users it depends on what version of Sourcegraph you are running.
5664

57-
### Multi-repository context
65+
### Sourcegraph v5.3+
5866

59-
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.`
67+
In Sourcegraph v5.3+, access to Cody is managed via user roles. By default, all users have access.
6068

61-
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.
69+
First, ensure Cody is enabled in your site configuration. Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set:
6270

63-
### @-mention directory
71+
```json
72+
{
73+
// [...]
74+
"cody.enabled": true,
75+
// Make sure cody.restrictUsersFeatureFlag is not in your configuration! If it is, remove it.
76+
}
77+
```
6478

65-
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.
79+
<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>
6680

67-
To do this, type `@` in the chat, and then select **Directories** to search other repositories for context in your codebase.
81+
Next, go to **Site admin > Users & Auth > Roles** (`/site-admin/roles`) on your instance. On that page, you can:
6882

69-
![@-mention-directory](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-ent-at-mention-dir-1124.png)
83+
- Control whether users **by default** have access to Cody (expand `User [System]` and toggle **Cody** > **Access** as desired)
84+
- Control whether groups of users have access to Cody (`+Create role` and enable the **Cody** > **Access** toggle as desired)
7085

71-
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.
86+
### Sourcegraph v5.2 and earlier
7287

73-
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.
88+
In Sourcegraph v5.2 and earlier, you should use the feature flag `cody` to turn Cody on selectively for some users. To do so:
7489

75-
## Supported LLM models
90+
- Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set:
7691

77-
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.
92+
```json
93+
{
94+
// [...]
95+
"cody.enabled": true,
96+
"cody.restrictUsersFeatureFlag": true
97+
}
98+
```
7899

79-
<FeatureParity type='ent' />
80-
For the supported LLM models listed above, refer to the following notes:
100+
- Next, go to **Site admin > Feature flags** (`/site-admin/feature-flags`)
101+
- Add a feature flag called `cody`
102+
- Select the `boolean` type and set it to `false`
103+
- Once added, click on the feature flag and use **add overrides** to pick users that will have access to Cody
81104

82-
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)
83-
2. Claude 2.1 is not recommended
84-
3. Sourcegraph doesn’t recommend using the GPT-4 (non-Turbo), Claude 1, or Claude 2 models anymore
85-
4. Only supported through legacy completions API
86-
5. BYOK (Bring Your Own Key) with managed services are only supported for Self-hosted Sourcegraph instances
87-
6. GPT-4 and GPT-4o for completions have a bug that is resulting in many failed completions
105+
![add-overrides](https://user-images.githubusercontent.com/25070988/235454594-9f1a6b27-6882-44d9-be32-258d6c244880.png)
88106

89-
### Supported model configuration
107+
## Configure Cody for LLM providers
90108

91-
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.
109+
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.
92110

93-
<FeatureParity type='configuration' />
111+
There are two ways of configuring Cody for LLM providers:
94112

95-
For the supported LLM model configuration listed above, refer to the following notes:
113+
<QuickLinks>
96114

97-
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)
98-
2. Claude 2.1 is not recommended
99-
3. Sourcegraph doesn't recommend GPT-4 non-turbo, Claude 1 or 2 models
100-
4. Only supported through legacy completions API
101-
5. BYOK (Bring Your Own Key) with managed services are only supported for Self-hosted Sourcegraph instances
115+
<QuickLink title="Completions" icon='lightbulb' href="/cody/enterprise/completions-configuration" description="How to configure Cody using the completions." />
116+
117+
<QuickLink title="Model Configuration" icon='installation' href="/cody/enterprise/model-configuration" description="How to configure Cody using the model configuration." />
118+
119+
</QuickLinks>

0 commit comments

Comments
 (0)