Model or dataset
civitai/civitai avatar
civitai/civitai

Civitai: The Open-Source Platform for Sharing and Discovering Generative AI Models

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

7,256 stars733 forksTypeScriptApache-2.0

At a glance

What is it?
Civitai is an Apache-2.0-licensed web platform built on Next.js, tRPC, and Prisma that lets communities host, browse, and share generative AI models, workflows, and datasets. The codebase is actively developed with a push as recently as 2026-09-25, but local setup requires Node.js 24.19.0 exactly, pnpm, and a six-service Docker stack, making it primarily a contributor environment rather than a lightweight self-hosted registry.
Who is it for?
Civitai is worth running locally for engineers contributing features to the platform or building a custom generative AI model discovery experience on top of the open codebase. Teams that plan to run it as a production model registry should verify access to the event-engine-common submodule, confirm that the signals and buzz private services are not required for their use case, and provision the full six-container Docker stack before committing to the approach.
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 4 days 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 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Civitai is and the problem it addresses

Civitai is an open-source platform purpose-built for sharing Stable Diffusion models and other generative AI assets. The README describes its goal as creating a place where people can upload textual inversions, hypernetworks, aesthetic gradients, VAEs, and other model customizations, collaborate on improving them, and comment on each other's work. The live production instance runs at civitai.com.

The repository is the full application codebase: frontend, backend, API, database schema, Docker configuration, and CI tooling. It is not a plugin, a library, or a standalone tool that drops into an existing platform. A team running Civitai gets the same application that powers the public site, including model browsing, user accounts, comments, and ratings. The Apache-2.0 license permits modification and redistribution, including commercial use, as long as the license notice is preserved.

The platform version in package.json is 5.1.142, and the most recent push reached the repository on 2026-09-25. Development is ongoing.

The Next.js, tRPC, and Prisma technology stack

The application runs on Next.js for both the frontend rendering and the backend API routes. All API communication between client and server goes through tRPC, which generates type-safe call signatures from a shared schema. The database ORM is Prisma, backed by PostgreSQL. The Mantine component library provides the UI. File storage in production uses Cloudflare; in local development, MinIO replaces it as an S3-compatible object store.

The package manager is [email protected]. The preinstall hook in package.json runs `npx only-allow pnpm`, which exits with error 1 if npm or yarn is attempted. Node.js is declared as `>=24.0.0 <25` in the engines field, with the exact version 24.19.0 pinned in .nvmrc. The engines guard is soft: `pnpm install` prints `WARN Unsupported engine` rather than failing, so an incorrect Node version surfaces as test failures later rather than as a refusal during installation.

The monorepo uses pnpm workspaces. The apps/ directory contains sub-applications including an auth app, a moderator app, a creator studio, and a training studio, each runnable independently with dedicated `pnpm dev` scripts.

Installing the local development stack

The README documents a standard setup sequence:

sh
git clone https://github.com/civitai/civitai.git
cd civitai
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

`nvm use` reads .nvmrc and switches to Node 24.19.0. `corepack enable` picks up the `packageManager` field from package.json to activate the declared pnpm version without a manual install. The `git submodule update --init event-engine-common` step initializes a submodule; the README does not describe its contents or whether external contributors can access the remote it points to.

After the services start, MinIO requires manual configuration before file uploads work. The README instructs opening the MinIO console at http://localhost:9001 with username `minioadmin` and password `minioadmin`, creating an access key, then copying the key and secret into four environment variables in .env.development: `S3_UPLOAD_KEY`, `S3_UPLOAD_SECRET`, `S3_IMAGE_UPLOAD_KEY`, and `S3_IMAGE_UPLOAD_SECRET`. The README states that most defaults in .env-example work without changes, but these S3 credentials are an explicit exception.

The Makefile provides convenience targets. `make bootstrap-db` seeds the database using a TypeScript script at scripts/local-dev/gen_seed.ts. `make run-migrations` applies pending Prisma migrations. `make bootstrap-metrics` triggers metrics and search data jobs.

The Docker service layer: what each container does

docker-compose.base.yml starts six services that a contributor needs: PostgreSQL on port 5432 (mapped to host port 15432), Redis, MinIO, Meilisearch, ClickHouse, and a mail catcher. The Makefile pins the Compose project name to `civitai` via `COMPOSE_PROJECT_NAME ?= civitai`. The comment in the Makefile explains the reason: without this pin, each git worktree would start its own stack and the second instance would fail on port conflicts.

The production Dockerfile builds from `node:24.19.0-alpine3.24`. The build uses a multi-stage approach: a `deps` stage installs dependencies with a pnpm store cache mount, and a `builder` stage compiles the Next.js application. The Dockerfile comment notes that the builder stage inherits from `deps` rather than starting from a fresh Node image; this preserves the nested workspace node_modules that `next build` requires.

docker-compose.yml, which extends docker-compose.base.yml, adds two further services: `signals-api` and `buzz`. These pull from private `ghcr.io/civitai` images. External contributors without a GitHub personal access token with `read:packages` scope cannot pull these images and cannot run the extended stack. The base compose file covers all publicly accessible parts of the application.

Known limitations: devcontainer Node version and Windows WSL

The devcontainer configuration ships with a known version mismatch. The README states that `.devcontainer/public/docker-compose.yml` pins `mcr.microsoft.com/devcontainers/typescript-node:1-22`, which is Node 22. Node 22 falls outside the declared `engines.node: >=24.0.0 <25` range. The closest tag at time of documentation was `3-24`, but the README notes the devcontainer was not updated because the change could not be exercised for testing. Using the devcontainer as shipped produces the same soft-warning behavior as using the wrong Node version on a host machine.

Windows users should clone the repository onto a WSL volume or use the "clone repository in named container volume" DevContainers option. Cloning directly to a Windows path produces performance issues, according to the README.

The NixOS path is addressed through a Nix flake. The flake.nix file provides a `nix run .#dev` command that handles the entire bootstrap: checking Docker, initializing the submodule, copying .env-example if absent, starting the container stack, waiting for PostgreSQL, running `pnpm install`, and starting the dev server at http://localhost:3000. The README marks this as optional and not the supported default.

Civitai versus Hugging Face Hub as a model registry

Hugging Face Hub is the most widely deployed alternative for sharing and discovering machine learning models. The difference in approach is fundamental. Hugging Face Hub is a SaaS platform with a hosted service; it does not offer a publicly available open-source codebase you can deploy as your own instance with full feature parity. Civitai is an open-source codebase designed to be self-deployed, with the tradeoff that operating it requires provisioning and maintaining PostgreSQL, Redis, MinIO, Meilisearch, ClickHouse, and the application itself.

Teams that need a model registry with a known operational cost and no infrastructure maintenance will find Hugging Face Hub a better match. Teams that need to own the full model discovery experience, customize the metadata schema, or integrate generative AI model browsing into an internal platform should evaluate Civitai's codebase as a starting point. The Apache-2.0 license does not restrict commercial self-hosted deployments.

Editorial conclusion

Civitai is worth running locally for engineers contributing features to the platform or building a custom generative AI model discovery experience on top of the open codebase. Teams that plan to run it as a production model registry should verify access to the event-engine-common submodule, confirm that the signals and buzz private services are not required for their use case, and provision the full six-container Docker stack before committing to the approach. Any team that needs a hosted model catalog without infrastructure overhead should evaluate a managed service. The Civitai codebase is architected for active contributors, and the local setup reflects that assumption.

Frequently asked questions

Is Civitai a legitimate platform?

Civitai is an open-source project licensed under Apache-2.0, with its full source code publicly available on GitHub at civitai/civitai. The production platform at civitai.com is built from this codebase and is used for sharing generative AI models.

Is Civitai free to use?

The Civitai source code is open-source under the Apache-2.0 license, which permits use, modification, and redistribution including commercial deployments. Running your own instance requires provisioning a six-service Docker stack that includes PostgreSQL, Redis, MinIO, Meilisearch, and ClickHouse.

how to use civitai models

The Civitai platform exposes model assets through its web interface and API layer. The repository documents local development setup with `pnpm dev`, which starts the full Next.js application at http://localhost:3000, where models can be browsed and accessed through the same interface as the production site.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/civitai-civitai.svg)](https://hysenlabs.com/projects/civitai-civitai)