You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,7 +20,8 @@ Sourcegraph-supplied models come with preconfigured providers, identified by the
20
20
21
21
### Override provider config for all models in the namespace
22
22
23
-
When Sourcegraph-supplied models are used and a provider override for a Sourcegraph-supported provider (same ID) is specified, the override applies to all Sourcegraph-supplied models within that provider.
23
+
When Sourcegraph-supplied models are used and a provider override for a Sourcegraph-supported provider (same ID) is specified,
24
+
the override applies to all Sourcegraph-supplied models within that provider.
24
25
For example, if you specify an override for a provider with ID `"anthropic"`, it will apply to all models from the `"anthropic"` provider.
25
26
26
27
Example configuration:
@@ -55,66 +56,187 @@ In the configuration above, we:
55
56
- Route requests for Anthropic models directly to the Anthropic API (via the provider override specified for "anthropic").
56
57
- Route requests for other models (such as the Fireworks model for "autocomplete") through Cody Gateway.
57
58
58
-
### Override provider configur for some models and use the Sourcegraph-configured provider config for the rest
59
+
### Override provider config for some models in the namespace and use the Sourcegraph-configured provider config for the rest
59
60
60
-
It's possible to route requests directly to the LLM provider (bypassing the Cody Gateway) for some models while using the Sourcegraph-configured provider config for the rest.
61
+
It's possible to route requests directly to the LLM provider (bypassing the Cody Gateway) for some models while using the
62
+
Sourcegraph-configured provider config for the rest.
61
63
62
64
Example configuration:
63
65
66
+
In the configuration above, we:
67
+
68
+
- Enable Sourcegraph-supplied models (the `sourcegraph` field is not empty or `null`).
69
+
- Define a new provider with the ID `"anthropic-byok"` and configure it to use the Anthropic API.
70
+
- Since this provider is unknown to Sourcegraph, no Sourcegraph-supplied models are available for it.
71
+
Therefore, we add a custom model in the `"modelOverrides"` section.
72
+
- Use the custom model configured in the previous step (`"anthropic-byok::2024-10-22::claude-3.5-sonnet"`) for `"chat"`.
73
+
Requests are sent directly to the Anthropic API as set in the provider override.
74
+
- For `"fastChat"` and `"autocomplete"`, we use Sourcegraph-supplied models via Cody Gateway.
75
+
76
+
## Config examples for various LLM providers
77
+
78
+
Below are configuration examples for setting up various LLM providers using BYOK.
79
+
These examples are applicable whether or not you are using Sourcegraph-supported models.
80
+
81
+
**Note:**
82
+
83
+
- In this section, all configuration examples have Sourcegraph-supplied models disabled. To use a combination of
84
+
Sourcegraph-supplied models and BYOK, please refer to the previous section.
85
+
- Ensure that at least one model is available for each Cody feature ("chat", "edit", "autocomplete"), regardless of
86
+
the provider and model overrides configured. To verify this, [view the configuration](/cody/model-configuration#view-configuration)
87
+
and confirm that appropriate models are listed in the `"defaultModels"` section.
0 commit comments