mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:51:57 +00:00
Code AI platform with Code Search & Cody
This PR greatly relaxes the naming restrictions for resource IDs when using the new `modelconfig` LLM model configuration system. The original intent was to set a high bar for how we would allow users to refer to LLM providers, API versions, or models. So that we could have use those names in URLs and/or display them if no human-friendly name was supplied. e.g. `opanai::v1::gpt-3.5-turbo`. However, in practice, this was just a bit too optimistic. We already had carved out an exception for "API versions" to be less strict, since there were some cases where we saw those included slashes and things. And one of our trusted testers immediately ran into problems because the model name had an `@` in it. (See the linked issue.) In order to avoid perpetually trying to work around LLM providers and whatever IDs they use for things, it seemed preferable to just relax our rules. With this PR, we will constraint Provider, API Versions, and Model IDs to only be URL-safe(*). So previously characters like `[]@/+;!` were prohibited, they are now allowed.) However, we still restrict names to only include `a-zA-Z` and no unicode characters, and curly braces are not allowed. (But `[]` and `()` are. > Pedantically, we do not want to say they are _exactly_ URL safe. Because we don't perform any sort of escaping (e.g. "%20" -> " ", etc.) Nor do we allow the `:` which _is_ allowed by the RFC, since we are using that to delimit parts of the model ref. Anyways, this should provide enough flexibility to avoid most (hopefully all) problems users would encounter. While still enforcing some type of standards with regard to how models are defined. Fixes [PRIME-451 : invalid ModelID (claude-3-5-sonnet@20240620) after upgrading to 5.5.2463](https://linear.app/sourcegraph/issue/PRIME-451/invalid-modelid-claude-3-5-sonnet20240620-after-upgrading-to-552463).) ## Test plan Added tests. ## Changelog NA. |
||
|---|---|---|
| .apko | ||
| .aspect | ||
| .buildkite | ||
| .github | ||
| .vscode | ||
| client | ||
| cmd | ||
| dev | ||
| doc | ||
| docker-images | ||
| internal | ||
| lib | ||
| migrations | ||
| monitoring | ||
| schema | ||
| testing | ||
| third_party | ||
| third-party-licenses | ||
| tools | ||
| ui/assets | ||
| wolfi-images | ||
| wolfi-packages | ||
| .bazel_fix_commands.json | ||
| .bazelignore | ||
| .bazeliskrc | ||
| .bazelrc | ||
| .bazelversion | ||
| .dockerignore | ||
| .editorconfig | ||
| .eslintrc.js | ||
| .gitattributes | ||
| .gitignore | ||
| .graphqlrc.yml | ||
| .hadolint.yaml | ||
| .mailmap | ||
| .mocharc.js | ||
| .npmrc | ||
| .pre-commit-config.yaml | ||
| .prettierignore | ||
| .stylelintignore | ||
| .stylelintrc.json | ||
| .swcrc | ||
| .tool-versions | ||
| .trivyignore | ||
| BUILD.bazel | ||
| CHANGELOG.md | ||
| CODENOTIFY | ||
| CONTRIBUTING.md | ||
| deps.bzl | ||
| doc.go | ||
| eslint-relative-formatter.js | ||
| flake.lock | ||
| flake.nix | ||
| gen.go | ||
| go.mod | ||
| go.sum | ||
| graphql-schema-linter.config.js | ||
| LICENSE | ||
| LICENSE.enterprise | ||
| linter_deps.bzl | ||
| mockgen.temp.yaml | ||
| mockgen.test.yaml | ||
| mockgen.yaml | ||
| nogo_config.json | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| postcss.config.js | ||
| prettier.config.js | ||
| README.md | ||
| release.yaml | ||
| renovate.json | ||
| SECURITY.md | ||
| service-catalog.yaml | ||
| sg.config.yaml | ||
| shell.nix | ||
| stamp_tags.bzl | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
| vitest.shared.ts | ||
| vitest.workspace.ts | ||
| WORKSPACE | ||
Docs •
Contributing •
Twitter •
Discord
Sourcegraph makes it easy to read, write, and fix code—even in big, complex codebases.
- Code search: Search all of your repositories across all branches and all code hosts.
- Code intelligence: Navigate code, find references, see code owners, trace history, and more.
- Fix and refactor: Roll out large-scale changes to many repositories at once and track big migrations.
Getting started
Development
Refer to the Developing Sourcegraph guide to get started.
Documentation
The doc directory has additional documentation for developing and understanding Sourcegraph:
- Architecture: high-level architecture
- Database setup: database best practices
- Go style guide
- Documentation style guide
- GraphQL API: useful tips when modifying the GraphQL API
- Contributing
License
This repository contains primarily non-OSS-licensed files. See LICENSE.
Copyright (c) 2018-present Sourcegraph Inc.