Model or dataset
civitai/civitai avatar
civitai/civitai

Civitai: a production-grade model sharing platform you can run locally

Civitai is a platform for sharing and discovering generative AI models, workflows, and datasets with practical usage metadata for production deployments.

7,246 stars734 forksTypeScriptApache-2.0

At a glance

What is it?
Civitai's repository is the full source of the model-sharing site, built with Next.js, tRPC, and Prisma. It is a heavy, container-heavy stack aimed at contributors, not at end users who just want to browse models.
Who is it for?
Adopt this repository if you are a developer who needs to contribute features to the Civitai platform itself, or if you want to run a private instance for experimentation with the exact same stack that powers the public site. Do not adopt it if you just want to host models for your team: the setup requires Docker, Node 24.19.0, pnpm, and six containerized services, and the documentation warns that the devcontainer is out of step with the required Node version.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 14, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What Civitai actually is and who it is for

Civitai is a platform for sharing and discovering generative AI models, workflows, and datasets. The README describes the goal as letting people share stable diffusion models, textual inversions, hypernetworks, aesthetic gradients, VAEs, and other customizations, with comments and feedback for collaboration. The repository is the full source of the public site, not a lightweight library or a self-hosted package. It is aimed at contributors who want to develop the platform itself, and at operators who want to run a full instance. The description mentions "practical usage metadata for production deployments," but the README does not detail that metadata. If you are an end user looking for a model browser, this repository is not for you; the public site already does that. The value here is in running the whole stack locally to work on the codebase.

The stack: Next.js, tRPC, Prisma, and six containers

The tech stack is explicit: DB is Prisma + Postgres, API is tRPC, front-end and back-end are Next.js, UI kit is Mantine, and storage is Cloudflare. The README also lists Redis, MinIO, Meilisearch, ClickHouse, and a mail catcher as containers in docker-compose.base.yml. That is a serious set of dependencies. The architecture is a typical modern full-stack monolith with a tRPC API, which means type-safe client-server communication without a separate REST layer. Prisma handles the database schema and migrations. The use of ClickHouse suggests analytics or event logging, though the README does not explain its role. The signals and buzz services, mentioned in docker-compose.yml, come from private ghcr.io images and are only available to internal members, so external contributors cannot run the full production environment. This split is a real constraint: you can run the base stack, but not everything.

Getting it running: exact commands and version pins

The README gives a precise setup sequence. You need Docker with Compose v2, Node.js 24.19.0 exactly (the .nvmrc file holds it), and pnpm, which is enforced via a preinstall hook that exits 1 if you use npm. The standard setup is: git clone, nvm use, corepack enable, git submodule update --init event-engine-common, cp .env-example .env.development, docker compose -f docker-compose.base.yml up -d, pnpm install, pnpm dev. After first start, you must edit .env.development, specifically the S3 upload credentials. The MinIO console runs at localhost:9001 with username and password both minioadmin, and you create an access key to fill S3_UPLOAD_KEY, S3_UPLOAD_SECRET, S3_IMAGE_UPLOAD_KEY, and S3_IMAGE_UPLOAD_SECRET. The README warns that most defaults work, but these do not. There is also a Nix flake for NixOS users, because Prisma has no linux-nixos build. The flake command nix run .#dev handles everything, including starting containers and installing dependencies, and it is idempotent. For devcontainers, the README flags that the public devcontainer pins Node 22, which is outside the engines range, so it will warn and then misbehave.

A real limitation: the devcontainer is out of step

The README includes a warning that .devcontainer/public/docker-compose.yml pins Node 22, which is outside the engines.node range of >=24.0.0 <25. The container comes up and pnpm install warns rather than stops, so you get odd test failures that look like they come from your branch. The README says there is no 1-24 tag, only 3-24, and that the maintainers did not change it because they could not exercise it. This is a genuine failure mode for new contributors who rely on devcontainers. You will waste time debugging environment issues instead of code. The recommended path is the standard setup with nvm use, not the devcontainer. Another limitation is that the signals and buzz services are private, so external contributors cannot run the full stack. The README says these are for internal members only, which means any feature that depends on them cannot be tested locally by outsiders.

The Nix flake: a workaround for a specific platform gap

The Nix flake exists for one reason: NixOS cannot use Prisma's published engines because there is no linux-nixos build. The README is explicit that the flake is optional and not the supported default, and that you can ignore it if you are not on NixOS. The flake owns the toolchain, so you do not install Node or pnpm yourself. nix run .#dev checks Docker, checks out the event-engine-common submodule, creates .env.development from the example, starts the container stack, waits for Postgres, runs pnpm install, and starts the dev server on localhost:3000. It is idempotent, so re-running is safe. There are variants: --no-start to bootstrap only, --full to also start the signals and buzz containers, and nix run .#doctor to check pins. This is a pragmatic solution, but it adds a layer of complexity that most contributors will not need. The README's tone suggests the maintainers added it out of necessity for a small set of users, not as a primary path.

Alternatives: how this compares to a simple model registry

The obvious alternative is to use a generic model registry like Hugging Face's hub, but that is a hosted service, not a self-hosted repository. If you want to self-host, you could build a simpler solution with just a Postgres database and an object store, skipping the full Next.js and tRPC stack. The difference is scale: Civitai includes search (Meilisearch), analytics (ClickHouse), and event handling (signals and buzz), which are overkill for a small team. Another alternative is to fork a minimal stable diffusion model sharing template, but that would lack the mature features like user accounts, comments, and model metadata that Civitai has. The real trade-off is operational complexity versus feature completeness. If you need the full platform, Civitai gives it to you, but you must run six containers and manage S3 credentials. If you only need to share a few models, a simple file server with a database is far cheaper to maintain. The README does not compare itself to any alternative, but the container count alone tells the story.

Maintenance and upgrade cost, and license implications

The repository is under Apache-2.0, which is permissive and allows commercial use, modification, and distribution, with the requirement to preserve license notices. The README does not mention any contributor license agreement or trademark restrictions, so the main cost is operational. The project pins Node to a narrow range (>=24.0.0 <25) and the exact version in .nvmrc, which means upgrades require coordination. The README shows that pnpm install only warns on unsupported engines, so you can run the wrong Node version and hit cryptic failures. The devcontainer is already out of step, which suggests the maintenance burden is non-trivial. The database uses Prisma, so schema changes require migrations, and the README has a section on data migrations for contributors, but the truncated part does not give specifics. The signals and buzz services are private, so you cannot easily upgrade or modify them. In short, expect to spend time on environment management, not just feature code.

Editorial conclusion

Adopt this repository if you are a developer who needs to contribute features to the Civitai platform itself, or if you want to run a private instance for experimentation with the exact same stack that powers the public site. Do not adopt it if you just want to host models for your team: the setup requires Docker, Node 24.19.0, pnpm, and six containerized services, and the documentation warns that the devcontainer is out of step with the required Node version. Before adopting, verify that your environment can run Prisma with your operating system (the Nix flake exists only because Prisma lacks a linux-nixos build), and check that you have access to the private ghcr.io images if you need the signals and buzz services. The project is actively maintained and Apache-2.0, so licensing is permissive, but the operational overhead is real.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
Community notes

Community notes