Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Self hosted models#4913

Merged
emidoots merged 7 commits into
mainfrom
sg/self-hosted-models
Jul 19, 2024
Merged

Self hosted models#4913
emidoots merged 7 commits into
mainfrom
sg/self-hosted-models

Conversation

@emidoots

Copy link
Copy Markdown
Member

These are the initial client changes needed for Cody Enterprise customers to be able to use self-hosted models. Specifically, this PR pairs with https://github.com/sourcegraph/sourcegraph/pull/63899

The first commit here is mostly changes @jamesmcnamara made to help me wire through the Model to the actual location where we write autocomplete providers. The following commits are me introducing a new generic openaicompatible autocomplete provider, which will supersede/replace the older experimental one which was purely client-side.

Combined with https://github.com/sourcegraph/sourcegraph/pull/63899 - these changes are enough to have at least Chat and Autocomplete working fairly well using a self-hosted Starcoder2 and Mixtral 8x7b Instruct model.

In this PR, the autocomplete provider is mostly tailored towards models in those families (starcoder and mixtral/mistral instruct models) - to unblock some customer use-cases - but all of the Model clientSideConfiguration options piped down to this autocomplete provider should be enough to generalize this approach to any model in the future. In a follow-up PR, I will begin making use of that clientSideConfiguration to enable using other self-hosted models and other use-cases (letting the site admin customize prompting, etc.)

Test plan

  • The first commit from James has nice unit tests.
  • The new autocomplete provider doesn't yet, I will add these in a future PR. For now, it is manually tested on my end using:

Stephen Gutekanst added 3 commits July 17, 2024 17:24
Authored 99% by James (thank you!)

Signed-off-by: jamesmcnamara <james.mcnamara@sourcegraph.com>
Co-authored-by: Stephen Gutekanst <stephen@sourcegraph.com>
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>

@jamesmcnamara jamesmcnamara left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent an embarassingly long time reviewing the exopenaicompatibile file before realizing it was a rename.

I can't comment too heavily on the config driven provider creation, and without tests I have to rely on you to verify that it is working properly. I think there's some abstraction and testing that should be added to this, but in the effort to unblock this, I'll approve.

I also added a commit to fix some CI errors.

Comment on lines +297 to +298
// TODO(slimsag): self-hosted-models: eliminate model-specific conditionals here entirely
// by relying on ClientSideConfig appropriately.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@emidoots emidoots merged commit 0e9ee8c into main Jul 19, 2024
@emidoots emidoots deleted the sg/self-hosted-models branch July 19, 2024 01:12
pkukielka referenced this pull request in sourcegraph/jetbrains Jul 22, 2024
This PR update's cody commit. The most important LLM selection dropdown
**with self hosted models** is expected to be visible for enterprise
users now.

The important PRs from Cody to be included:
- https://github.com/sourcegraph/cody/pull/4913 (self hosted models)
- ~https://github.com/sourcegraph/cody/pull/4706 ([a bug with
paths](https://github.com/sourcegraph/cody/pull/4706#discussion_r1658684268)?
[slack
thread](https://sourcegraph.slack.com/archives/C05AGQYD528/p1721382757890889))~
FIXED BY https://github.com/sourcegraph/cody/pull/4955

## Test plan
1. full QA
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants