Sourcegraph Cody alternatives you can self-host

Kilo Code and twinny are the closest self-hosted coding assistants with codebase indexing, with Zoekt (Apache 2.0) covering cross-repository code search, and the main trade-off is that your organization runs the model servers, indexes and staff itself instead of relying on Cody's hosted routing. Cody is no longer offered on the Free, Pro or Enterprise Starter plans from July 23, 2025, so this page covers organizations that need an alternative regardless of their Cody plan.

On this page

Which self-hosted alternatives replace Cody for code assistance

If your organization cannot send source code through Cody's model routing, the closest self-hosted options are Kilo Code (MIT licensed) and twinny (MIT licensed), both of which offer codebase indexing, and Zoekt (Apache 2.0) for code search across many repositories. The trade-off is that your team runs the model servers, the indexes and the upkeep itself, so the decision is as much about staffing and operations as about licensing. Cody stopped being offered on the Free, Pro and Enterprise Starter plans from July 23, 2025, and Cody Enterprise customers are not affected. That means the alternative question mainly concerns Enterprise buyers who want code to stay inside their own infrastructure, not individual developers on lower tiers.

Kilo Code is a coding agent for VS Code, JetBrains and the CLI. Its codebase indexing builds embeddings for semantic search, and its documentation says that pairing Ollama embeddings with the default LanceDB vector store keeps indexing on the user's machine. For teams and larger codebases, the docs recommend an external Qdrant server, which becomes another service your platform team must patch, back up and monitor. Check the current indexing documentation in the Kilo Code codebase indexing docs before you commit, and confirm which embedding and vector store combinations your security team has reviewed.

twinny is a VS Code extension that provides chat over a workspace index combining keyword and vector search, plus code completion. It works against model servers such as Ollama, LM Studio, llama.cpp or any OpenAI-compatible server, and its README states it has no telemetry. Its team gateway is free for five developers, while a paid licence adds seats, team policy and plugins including OpenID Connect SSO and one shared context index for every developer's chat. Zoekt, maintained by Sourcegraph since it forked the project from Google's original repository in 2017, handles trigram-based search across many repositories through its indexserver and webserver. Before rollout, confirm each license, the telemetry behavior of the version you deploy, and whether your model servers and code hosts will accept the sync and network paths these tools need.

License and edition terms for each self-hosted option

This table compares the license and paid terms of the open-source coding assistants and code search engine covered on this page, with Cody Enterprise listed for reference. Each row separates what is free from what is paid, and the final column names the clauses to read in the license text before approval. The main takeaway: the MIT and Apache 2.0 projects carry no license fee of their own, so the cost sits in hosting, models and any paid team features.

OptionLicense and what is freeWhat is paidWhat to confirm in the license text
Kilo CodeMIT. Open-source coding agent for VS Code, JetBrains and the CLI. Release v7.8.40 published November 27, 2026.Not stated in the project's material. Confirm with the project whether any hosted or team features carry charges.Attribution and notice duties, and whether any hosted service or telemetry sits outside the MIT code.
twinnyMIT. VS Code chat and code completion with no telemetry, working against Ollama, LM Studio, llama.cpp or OpenAI-compatible servers.Team gateway is free for five developers. A paid license adds seats, team policy and plugins, including OpenID Connect SSO and one shared context index.Whether the paid license terms change the MIT grant for gateway and plugin code, and what the team gateway sends to its server.
ZoektApache 2.0. Trigram-based code search engine that Sourcegraph has maintained since forking it from Google's repository in 2017.No paid tier identified. Confirm with Sourcegraph whether any Zoekt features sit in its paid products.Apache 2.0 notice and attribution duties, and the license status of the indexserver and webserver components you deploy.
Cody Enterprise (reference)Commercial Enterprise contract. Cody left Free, Pro and Enterprise Starter plans on July 23, 2025; Enterprise customers are not affected.From $16K as a minimum annual contract, per Sourcegraph's pricing page (November 2026), with credits for AI features such as Deep Search.Whether Cody draws on those credits, and the single-tenant cloud, self-hosted and no-training terms in the order form.
Cody client codeApache License for the public cody-public-snapshot, which names one commit as the last made under Apache.Not applicable. Sourcegraph moved the current Cody code to a private repository.Which license covers any code after that commit, and whether you may reuse or fork the snapshot.

What self-hosted codebase indexing keeps on your own machines

Codebase indexing decides where your source code sits at rest, so confirm the index location before you approve any open-source assistant. Kilo Code's codebase indexing builds embeddings of your code for semantic search. Its documentation says that pairing Ollama embeddings with the default LanceDB vector store keeps indexing on the user's machine, and it recommends an external Qdrant server for teams and larger codebases. Those two choices are different risk decisions. A per-laptop LanceDB store is a copy of your code on each endpoint, which your device management and disk encryption controls must cover. A shared Qdrant server is a central store that needs its own access control, backups, network segmentation and audit logging. Check the Kilo Code codebase indexing documentation against the version your teams install, because the defaults are the part most likely to change.

twinny takes a different approach. Its VS Code chat runs over a workspace index that combines keyword and vector search, alongside code completion, and it is pointed at model servers such as Ollama, LM Studio, llama.cpp or any OpenAI-compatible server. Its README states that it has no telemetry, which is a useful starting point for a review, but it does not replace your own checks. Confirm with a network capture or egress test that the extension and the model server it calls behave as described on a test workstation. The team gateway's shared context index is a separate design choice: one index for every developer's chat means source excerpts from several people sit in one place, so decide who may query it and how long it is kept.

Before rollout, write down three decisions for each team: the embedding model, the vector store and the index location (laptop, team server or private cluster). Each one determines whether source code is stored at rest on endpoints, on a server you operate, or in both, and which backup, retention and deletion procedures apply. Ask the implementation team to show where the index files are written, who holds the credentials to the vector store, and how an index is removed when a developer leaves or a repository is archived. Those answers belong in your data flow record and your AI tool register, and they are what your security reviewer will ask for first.

How the parts connect in a self-hosted setup

The diagram starts at the developer's IDE, where Kilo Code (in VS Code, JetBrains or the CLI) or twinny (in VS Code) sends prompts to a model server the organization runs, such as Ollama, LM Studio, llama.cpp or any OpenAI-compatible server. Kilo Code's codebase indexing builds embeddings that can stay local with Ollama embeddings and the default LanceDB store, or move to an external Qdrant server for teams. Zoekt runs on a separate path, where its indexserver and webserver sync repositories from the code host for cross-repository search. Check that every box inside the boundary stays in your network, and that no step needs an external endpoint unless you add a hosted model provider.

Developer tools, model server, embedding layer and Zoekt search inside one trust boundary.

What running a self-hosted coding assistant takes in staff time and hardware

A self-hosted coding assistant is a set of components your team operates: a model server, an embedding and vector store, a code search index, the IDE clients and the access controls around them. Each card below covers one component or recurring task, and each is something to size and assign an owner for before the first developer connects.

Model server hosting

The model server is where completions and chat requests run, and it is the largest hardware decision in this setup. Size it for the specific models you choose, since the load depends on model size, context length and the number of concurrent developers. Confirm hardware and GPU requirements in each project's documentation rather than in general guidance, and ask who patches the server, rotates its model files and monitors its availability. Size the server against your chosen models before you buy hardware.

Embedding and vector store operation

Codebase indexing needs an embedding model and a vector store. Kilo Code's documentation says that pairing Ollama embeddings with the default LanceDB store keeps indexing on the user's machine, and it recommends an external Qdrant server for teams and larger codebases. Decide which store you run centrally, who backs it up, and how the index is rebuilt after a large merge or a repository move.

Codebase indexing docs

Zoekt indexserver and webserver operation

Zoekt provides trigram-based code search across many repositories. Its indexserver syncs repositories from your code host and its webserver serves the search, so both must keep pace with pushes and have the code host credentials to read every repository. Plan for a service account with read-only access, a sync schedule that matches your branching habits, and a check that newly created private repositories appear in the index.

Zoekt repository

IDE client rollout

Kilo Code runs in VS Code, JetBrains and the CLI, and twinny runs as a VS Code extension. Each client needs a version standard, a configuration that points developers at your model server and index, and a way to stop developers from pointing their client at a public provider. Confirm each client's configuration keys and how admins can enforce them before rollout, and test the setup on a small group of developers first.

Licence and version tracking

Kilo Code and twinny are both MIT licensed, so the free use cases carry few licence obligations, but the release cadence is the operational concern. Kilo Code published release v7.8.40 on November 27, 2026, so set a review cycle for upgrades and test each version against your model server. If you buy the twinny paid licence, track seat counts and renewal dates alongside the free five-developer team gateway limit.

Kilo Code repository

Access control and SSO

Access control covers who can reach the model server, the index and the code search, and whether developers sign in through your identity provider. The twinny paid licence adds OpenID Connect SSO and team policy, which is the route to central sign-in if you need it. Confirm whether the free gateway meets your requirements for identity and audit logging, and keep the model server and index off public networks.

twinny repository

Which self-hosted setup fits your team

A small team that wants a free, permissively licensed option can start with twinny or Kilo Code. Both are MIT licensed, both work against models the team already runs, and neither requires a Sourcegraph contract. The main limit is governance: a small team usually has no central admin console, so access control, logging and model choice rest on the individual developer's setup.

  • twinny: MIT licensed VS Code extension with chat over a workspace index and code completion. Its README states no telemetry and connection to Ollama, LM Studio, llama.cpp or any OpenAI-compatible server.
  • Kilo Code: MIT licensed coding agent for VS Code, JetBrains and the CLI. Pairing Ollama embeddings with the default LanceDB store keeps indexing on the user's machine, according to its codebase indexing docs.
  • Team gateway for twinny: The free team gateway covers five developers. Larger groups need a paid licence, so confirm the current seat terms before rollout.
  • Local hardware: Each developer's machine or a shared model server must run the models. Confirm hardware needs against the model you choose.

Before approving this setup, confirm the license file in the exact release you install, and confirm which model endpoint receives code and prompts.

What to check and collect before approving a self-hosted coding assistant

This sequence turns a proposal to replace Cody with a self-hosted coding assistant into a reviewable file covering licenses, edition choices, data locations, model providers, ownership of upgrades and a way back to a hosted tool. Each step ends with a document or decision that the approver can sign off.

  1. Pull and review each project license

    Assign someone on the legal or open-source review side to download the license text for each component: Kilo Code (MIT), twinny (MIT) and Zoekt (Apache 2.0), from the project repositories. Confirm that the license permits your intended use, including internal distribution, modification and running the tool for staff in your own environment. Record the license file, its version and the date you reviewed it. The step is done when each component has a signed license entry in your software inventory.

  2. Confirm the edition each team needs

    Decide which team will use each tool and which edition it requires. twinny's team gateway is free for five developers, while a paid licence adds seats, team policy and plugins, including OpenID Connect SSO and one shared context index for every developer's chat. Ask the vendor to confirm current terms for any feature you depend on, such as SSO or shared indexing, and whether those features are included in the free gateway. The output is a short edition table naming the tool, the seat count and the features that justify any paid licence.

  3. Map where code, embeddings and chat logs live

    Work with the platform team to draw a data flow for each assistant. Identify where source code is read, where embeddings are written, which vector store holds them and where chat history is saved. Kilo Code's docs say that pairing Ollama embeddings with the default LanceDB store keeps indexing on the user's machine, and that an external Qdrant server is recommended for teams and larger codebases. Verify those points in your own environment and record any path that leaves your network. The step closes with a data map that your security team has reviewed.

  4. Choose model providers and confirm Cody override options

    Select the model servers each assistant will call, such as Ollama, LM Studio, llama.cpp or an OpenAI-compatible endpoint hosted in your infrastructure. If Cody stays in use for some teams, confirm with Sourcegraph which provider overrides an Enterprise instance supports, since Cody requests go through Cody Gateway by default and provider overrides let the instance use your own keys or an OpenAI-compatible endpoint. Document every provider, the network path to it and who holds the credentials. The output is an approved provider list that matches the data map.

  5. Agree who patches and upgrades each component

    Name an owner for each layer: the assistant client in developer machines, the model server, the vector store, the Zoekt indexserver and webserver, and the host operating system. Agree how security patches are tested and rolled out, how version pins are recorded and who approves an upgrade. Kilo Code's current release at the time of writing is v7.8.40, so your owners should track releases through each project's repository rather than a fixed schedule. The step is done when every component has a named owner and a written upgrade procedure.

  6. Define support and vendor escalation

    Decide how users get help and who responds when an assistant or index fails. Open-source projects typically offer community channels, so determine whether you need a paid support contract, an internal on-call rota or an implementation partner such as DeployOpen, which plans, implements and supports self-hosted open-source platforms in your own infrastructure under a written scope. Ask any provider to state its support terms in writing. The output is a support matrix that lists the contact, the response expectation and the escalation path for each component.

  7. Write the exit path back to the hosted tool

    Document how you would return to Cody or another hosted assistant if the self-hosted setup fails review or becomes unsupported. Cover how indexes are deleted, how embeddings and chat logs are removed from local stores, how developer configurations are reset and what the hosted tool requires for re-onboarding. Confirm the current Cody plan availability with Sourcegraph before relying on it, because Cody is no longer offered on Free, Pro and Enterprise Starter plans from July 23, 2025, and Enterprise customers remain the path. The step closes when the exit plan is signed by the system owner.

What happened to Cody's open-source client code

Sourcegraph moved Cody's code to a private repository, so the code you can read in public is no longer the code Sourcegraph develops. The public cody-public-snapshot repository is a copy taken before that move, and it names one commit as the last made under the Apache License. Treat the snapshot as a historical record, not a current, maintained codebase. It will not contain fixes, features or security changes made after the move, and nothing in it tells you the license status of code written later.

Before you rely on any Cody code outside Sourcegraph's own distribution, get written confirmation from Sourcegraph of which code is available under which license, and whether that license covers the version you intend to run. Ask specifically whether the Apache License applies to any code after the named commit, whether the private repository is licensed for redistribution or modification, and what terms apply to customers of the Enterprise plan who self-host. Record the answer in your open-source approval file alongside the version you plan to use. If the answer is unclear, do not treat the snapshot as a license to build on it.

A self-hosting plan should not depend on forking the snapshot. A fork would start from an out-of-date codebase, carry the security exposure of that age, and take on license questions you have not resolved. The safer approach is to choose an open-source assistant with an active, publicly maintained repository and a license you have reviewed, such as the alternatives in this section, and to plan your own updates, testing and security review for it. Keep Cody in scope only through the Enterprise terms you negotiate directly with Sourcegraph.

What each license requires of your organization

Each self-hosted option carries its own license, and the obligations differ by tool. Kilo Code and twinny are MIT licensed, Zoekt is Apache 2.0, and a paid twinny licence or a Sourcegraph Enterprise contract adds commercial terms on top. Read each license and each contract before rollout, because the duties that apply to your organization depend on how you deploy and distribute the software.

MIT obligations for Kilo Code and twinny

The MIT License requires that the copyright notice and the license notice appear in copies of the software. For Kilo Code and twinny, this matters when your team copies, modifies, forks or redistributes the code inside or outside the organization, such as packaging an internal build for developers. Internal use of an unmodified release usually leaves little to track, but your legal team should confirm how the notices are kept in any internal fork. Read the license text in each repository before you publish an internal build.

Kilo Code repository

Apache 2.0 obligations for Zoekt

Zoekt is licensed under Apache 2.0, which asks redistributors to include the license, keep attribution notices, and mark changed files. If your team runs Zoekt as an internal search service without distributing it, the duties are lighter, but a custom build shipped to other teams or customers may trigger them. Confirm the exact conditions in the license text and in any NOTICE file in the repository, and record which version you deploy.

Zoekt repository

twinny paid licence conditions

twinny's team gateway is free for five developers, and a paid licence adds seats, team policy and plugins such as OpenID Connect SSO and one shared context index. The MIT license covers the open-source code, but seat counts, policy features and SSO are sold features governed by the purchase agreement, not by the open-source license. Before buying, confirm the seat terms, renewal and support scope, and whether the SSO and shared index continue if you stop paying.

Sourcegraph Enterprise contract terms

If you buy Sourcegraph Enterprise to run Cody or Zoekt, your rights come from the Sourcegraph contract, not from the open-source licenses alone. Confirm in writing that the agreement covers self-hosted use, the model provider keys you bring, and the data handling terms you rely on for security review. Ask who is responsible for updates and what happens to your deployment if the subscription ends.

Enterprise minimum
$16K
Sourcegraph pricing

What buyers ask before approving a self-hosted Cody alternative

Do the open-source Cody alternatives cost money to license?

No license fee applies to the core tools. Kilo Code and twinny are both MIT licensed, and Zoekt is licensed under Apache 2.0, so the organization can use, modify and run them without a license payment. Costs come from the infrastructure underneath them. twinny offers a paid licence for teams that want more seats, team policy and plugins, including OpenID Connect SSO and one shared context index for every developer's chat. Its team gateway is free for five developers. Confirm the current terms in each project's repository before approval, because a paid tier can add features the organization needs in production.

What drives the cost and effort of running a self-hosted coding assistant?

The main cost components are the model server, the vector store, staff time and ongoing upgrades. The model server needs GPU or CPU capacity sized for the models the team chooses, and that capacity recurs as a cloud bill or hardware cost. The vector store is local with the default LanceDB store in Kilo Code, and an external Qdrant server is recommended for teams and larger codebases, which adds a service to operate. Staff time covers installation, access control, monitoring, model updates and developer support. Ask any implementation partner for a written scope that lists each component, who operates it, and what it costs to keep it current.

Can our own team run a self-hosted Cody alternative without outside help?

A small team can usually build a pilot alone, since the tools install into VS Code, JetBrains or the command line and connect to a local model server such as Ollama. Production is a different matter. Single sign-on, audit logging, role-based access to repositories and a documented data handling process need planning before developers rely on the tool. Those controls sit mostly outside the coding assistant itself, so the team must decide how identity, logs and repository permissions are enforced. Many organizations use an outside partner for that design and for the security review, while keeping day-to-day operation in house.

Does codebase indexing stay on the developer's machine?

It stays on the machine only in one documented setup. Kilo Code's docs say that pairing Ollama embeddings with the default LanceDB vector store keeps indexing on the user's machine. Other embedding providers or an external Qdrant server change where code vectors are stored, so each choice needs its own data flow review. Confirm the exact embedding and vector store configuration in the Kilo Code codebase indexing documentation, then test with network monitoring that no source code leaves the approved environment during indexing or chat.

Can Cody Enterprise use our own model provider keys or an OpenAI-compatible endpoint?

Yes, Cody Enterprise supports this through provider overrides. Sourcegraph's model configuration docs say that without overrides, Cody's LLM requests route through Cody Gateway, while provider overrides let an Enterprise instance use the organization's own provider keys or any OpenAI-compatible endpoint. The docs also list Amazon Bedrock (Anthropic Claude models only), Azure OpenAI, Anthropic, Fireworks, Google Gemini and Vertex, OpenAI and Hugging Face TGI as supported providers. Cody is sold only to Enterprise customers, and the Cody FAQ states that self-hosted instances need internet access to reach external LLM services, so the network path must be reviewed. Ask Sourcegraph to confirm the configuration for your deployment.

How do we confirm a self-hosted model is good enough for our developers?

Test the model on the organization's own code, using tasks developers actually perform. Pick a set of representative repositories, languages and request types, such as bug fixes, refactors, test generation and questions about internal APIs. Score the answers with the engineers who own that code, and compare them against the current assistant on the same tasks. Record failures, including hallucinated function names and missed context from the index. Repeat the test after every model or embedding change. Public benchmark scores help with shortlisting but do not show how a model handles your codebase, so keep the evaluation in writing as part of the approval record.

What should a security reviewer check before approving the stack?

Start with the data path: where prompts, code snippets, embeddings and logs travel, and which services can receive them. Then check identity, meaning how developers authenticate, how repository permissions are enforced, and whether admin settings can be locked down. Review the update process for each open-source component, including who tracks security fixes and how upgrades are tested. Confirm that audit logs capture usage and that retention periods match your policy. Document each decision so auditors can trace how the system works, since DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors issue any report.

Who supports the open-source stack after launch, and who is accountable?

The open-source projects are maintained by their communities and by their sponsoring companies, so the organization holds the operational responsibility. Support falls into three groups: the project maintainers, who handle bugs in the code, your internal platform team, who runs the servers and keeps versions current, and any outside partner you retain for upgrades and monitoring. Ask for a written support model that names each owner, the response path for an outage, and the process for applying security patches. DeployOpen offers ongoing support, upgrades and continuous testing as retainers, and it agrees scope and deliverables in writing before work begins.

How DeployOpen helps you run a self-hosted coding assistant under your compliance rules

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For a coding assistant, that means your code, prompts and embeddings stay where your security and compliance teams can review them, with the model provider and access controls agreed in writing before work starts.

How we scope

  • We agree the written scope with your security, engineering and compliance leads before any work starts.
  • The scope names which assistant, indexing approach, code search engine and model servers are in and out.
  • Engagements are fixed-scope, with deliverables and timelines written down, and a quote follows from that scope.

How we build

  • We deploy the chosen open-source tools inside your infrastructure, connected to the model endpoints you approve.
  • We configure access control, audit logging and network egress so code and prompts follow your data handling rules.
  • We run security testing on the setup, including credential handling, file permissions and indexing data exposure.

How we hand over

  • You receive documentation of the architecture, data flows, permissions and configuration decisions for review.
  • We provide evidence your compliance team can use when assessing the tool, mapped to your own control set.
  • Your engineers receive working runbooks for installation, model switching, upgrades and index maintenance.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • We can retest the setup after tool upgrades, model changes or new repositories are added to the index.
  • Support scope and response arrangements are written into the retainer, so you know what is covered.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.