Enabling Cody on Sourcegraph Enterprise
This guide will walk you through the steps to install and set up Cody with your Sourcegraph Enterprise instance.
Cody enhances your coding experience by providing intelligent code suggestions, context-aware completions, and advanced code analysis.
Cody Enterprise features
To cater to your Enterprise requirements, Cody Enterprise offers the following features:
IDE Token Expiry
Site administrators can customize the time duration of the access token used by other users on the Sourcegraph Enterprise instance to connect Cody from their IDEs via the Site admin page. Administrators can choose from various options, including 7, 14, 30, 60, and 90 days.
Guardrails
Open source attribution guardrails for public code reduce the exposure to copyrighted code, commonly called copyright guardrails. This involves the implementation of a verification mechanism within Cody to ensure that any code generated by the platform does not replicate open source code.
Guardrails for public code are available to all Sourcegraph Enterprise instances and are disabled by default. You can enable it from the Site configuration. You can do so by setting "attribution.enabled": true
in site config.
It only matches code snippets that are at least 10 lines or longer, and the search corpus 290,000 open source repositories.
Admin Controls
Sourcegraph account admins have selective control over users' access to Cody Enterprise, which is now managed via the Sourcegraph role-based access control system. This provides a more intuitive user interface for assigning permission to use Cody.
Analytics
Cody Enterprise users get a clear view of usage analytics for their instance on a self-service basis. A separately managed cloud service for Cody analytics handles user auth, gets metrics data from Sourcegraph's BigQuery instance, and visualizes the metrics data.
The following metrics are available for Cody Enterprise users:
Metric Type | What is measured? |
---|---|
Active users | - Total active users - Average daily users - Average no. of days each user used Cody (of last 30 days) - Cody users by day (last 30 days) - Cody users by month (last two months) - Cody users by number of days used |
Completions | - Total accepted completions - Minutes saved per completion - Hours saved by completions - Cody completions by day - Completions acceptance rate - Weighted completions acceptance rate - Average completion latency - Acceptance rate by language |
Chat | - Total chat events - Minutes saved per chat - Hours saved by chats - Cody chats by day |
Commands | - Total command events - Minutes saved per command - Hours saved by commands - Cody commands by day - Most used commands |
To enable Cody Analytics:
- Create an account on Sourcegraph Accounts
- A user already having an account on Sourcegraph.com gets automatically migrated to Sourcegraph Accounts. Users can sign in to Cody Analytics using their email and password
- Users without a Sourcegraph.com account, please get in touch with one of our teammates. 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's analytics
Multi-repository context
Cody Enterprise supports searching up to 10 repositories to find relevant context in chat.
- In VS Code, open a new Cody chat, type
@
, and selectRemote Repositories
to search other repositories for context - In JetBrains, use the enhanced context selector
@-mention directory
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.
To do this, type @
in the chat, and then select Directories to search other repositories for context in your codebase.
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.
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.
Supported LLM models
Sourcegraph Enterprise supports many different LLM providers and models. You can use state of the art code completion models such as Anthropic's Claude or OpenAI's ChatGPT by adjusting your Sourcegraph instance's configuration.
Refer to the Model Configuration or Supported Models sections for more information. Use the drop-down menu to make your desired selection and get a detailed breakdown of the supported LLM models for each provider on Cody Enterprise.
For the supported LLM models listed above refer to the following notes:
- Microsoft Azure is planning to deprecate the APIs used in SG version less than
5.3.3
on July 1, 2024 Source - Claude 2.1 is not recommended
- Sourcegraph doesn't recommend GPT-4 non-turbo, Claude 1 or 2 models
- Only supported through legacy completions API
- BYOK with managed services are only supported for Self-hosted Sourcegraph instances
- GPT-4 and GPT-4o for completions has a bug that is resulting in many failed completions
Supported model configuration
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.
For the supported LLM model configuration listed above refer to the following notes:
- Microsoft Azure is planning to deprecate the APIs used in SG version less than
5.3.3
on July 1, 2024 Source - Claude 2.1 is not recommended
- Sourcegraph doesn't recommend GPT-4 non-turbo, Claude 1 or 2 models
- Only supported through legacy completions API
- BYOK with managed services are only supported for Self-hosted Sourcegraph instances