---
title: "Deploy SillyTavern Gemini"
description: "Chat with Google Gemini models in SillyTavern"
category: "AI/ML"
url: https://railway.com/deploy/deploy-sillytavern-with-google-gemini
---

# Deploy SillyTavern Gemini

Chat with Google Gemini models in SillyTavern

**[Deploy SillyTavern Gemini on Railway](https://railway.com/template/deploy-sillytavern-with-google-gemini)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-sillytavern-with-google-gemini/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### SillyTavern

- **Image:** ghcr.io/sillytavern/sillytavern:1.19.0@sha256:eef27ff0c7961f1a2f488400f581f48ff38f8b910c5d3b8d389138d71791bb14
- **Start command:** `/bin/sh -c 'set -e; cd /home/node/app; R=/home/node/app/data/_railway; if [ "$(stat -c %u data)" != 1000 ]; then chown -R 1000:1000 data; echo "volume: data handed to node (uid 1000)"; fi; su-exec node mkdir -p "$R/config" "$R/extensions" "$R/plugins"; for p in config:config plugins:plugins public/scripts/extensions/third-party:extensions; do s="${p%%:*}"; t="$R/${p##*:}"; if [ ! -L "$s" ]; then [ -d "$s" ] && su-exec node cp -an "$s/." "$t/"; rm -rf "$s"; ln -s "$t" "$s"; chown -h 1000:1000 "$s"; fi; done; if [ ! -e config/config.yaml ]; then su-exec node cp default/config.yaml config/config.yaml; echo "config: seeded data/_railway/config/config.yaml from defaults"; fi; if [ -n "$ADMIN_PASSWORD" ]; then H="${ADMIN_HANDLE:-default-user}"; if su-exec node node recover.js "$H" "$ADMIN_PASSWORD" >/dev/null; then echo "accounts: password for $H set from ADMIN_PASSWORD"; else echo "accounts: could not set password for $H" >&2; fi; fi; exec tini -- ./docker-entrypoint.sh'`
- **Health check:** /login
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted SillyTavern Gemini (LLM Chat Frontend for Google Gemini) on Railway

This template runs SillyTavern with a Google AI Studio API key, so you can chat with Gemini models using your own key.

## About Hosting SillyTavern Gemini open-source software on Railway (self hosted SillyTavern with Google Gemini template)

SillyTavern is an open-source, AGPL-3.0 chat frontend that ships no model, so you bring your own Google AI Studio key and pay Google per token.

Railway handles the public URL on port 8000, the health check, restarts and the volume mount. You still own the data and the keys.

## Why Deploy SillyTavern Gemini, the Gemini app alternative on Railway (Railway Free Trial)

The Gemini app locks your chats inside Google's consumer product and gives you no say over context size or safety settings. Railway's $5 trial covers a first look.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying SillyTavern Gemini on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway vs Other Hosting Providers and VPS for SillyTavern Gemini self hosting

Here is how Railway compares with renting a plain VPS for one SillyTavern instance that talks to Gemini through your own AI Studio key.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | One click deploy, a persistent volume for your Gemini key and chats, and a public HTTPS URL. | A droplet with full root access, but you handle Docker, the reverse proxy and updates. |
| AWS | A managed service with the volume and health check wired up, so no IAM or VPC setup. | More control and more services, but a steeper learning curve and a harder bill to predict. |
| Hetzner | The same one service stack with no server to patch, and a free trial for first tests. | Low cost per gigabyte of RAM, but you manage the OS, firewall and backups yourself. |

## Common Use Cases for hosted SillyTavern Gemini

- **Long-context roleplay on Gemini:** Gemini models offer large context windows, so long character chats with big lorebooks can keep more history in view. You set the context size in the connection settings.
- **Using a free AI Studio key:** Google AI Studio issues an API key without a billing setup, so you can test SillyTavern against Gemini for free. Free tier rate limits apply, and busy chats can hit them quickly.
- **Comparing Gemini models per character:** The same character can feel different across models. Run one scene on two Gemini models and see which voice fits.
- **Image captioning with a Gemini vision model:** SillyTavern can send an image to a Gemini vision model and return a caption. Caption quality depends on the model you choose.
- **A shared frontend on your own server:** Run one instance on Railway and give friends their own accounts. Each person keeps their own characters, chats and Gemini key.

## Dependencies for SillyTavern Gemini Docker hosted on Railway

This template is a single service with no database and no second container to wire up.

### Deployment Dependencies for Managed SillyTavern Gemini Service (LLM Chat Frontend)

- A Railway account, with the $5 trial covering a first look at the service.
- A Google AI Studio API key from https://aistudio.google.com/apikey, created with the Create API Key button.
- A browser to reach the public URL on port 8000 and log in with ADMIN_PASSWORD.
- Nothing else to provision: no database, no separate Node.js service.

### Implementation Details for SillyTavern Gemini (Using SillyTavern official docker image)

The service listens on public port 8000 with a health check on /login and a restart policy of ALWAYS.

## How does SillyTavern Gemini compare against other ways to chat with Gemini models

### SillyTavern Gemini vs Gemini app (Gemini app Alternative)

- **Model access:** The Gemini app gives you Google's chosen model. Here you pick the Gemini model yourself from the Google AI Studio connection and can switch it between chats.
- **Character memory:** The Gemini app is built for general assistant work. SillyTavern keeps character cards, lorebooks and chat history on your own volume, so a long roleplay stays consistent.
- **Where the app wins:** It needs no key, no setup and no server. If you just want quick answers, skip this and use the app.

### SillyTavern Gemini vs Google AI Studio (Google AI Studio Alternative)

- **Roleplay tooling:** AI Studio is a prompt playground. SillyTavern adds character cards, group chats and prompt presets built for ongoing conversation.
- **Key handling:** You create the key in AI Studio either way. SillyTavern stores it on your volume per account, so you paste it once instead of re-entering it in each session.
- **Where AI Studio wins:** It is the faster place to test a single prompt against a Gemini model, with no deployment in the way.

### SillyTavern Gemini vs Character.AI (Character.AI Alternative)

- **Model choice:** Character.AI runs its own hosted models with no bring-your-own option. Here Gemini is the model, and you can change it when you want.
- **Content filters:** Character.AI applies its own filters. With SillyTavern you set the Gemini safety settings yourself on your own server.
- **Where Character.AI wins:** It is hosted and works immediately on any device, with a large catalogue of ready-made characters.

### SillyTavern Gemini vs Janitor AI (Janitor AI Alternative)

- **Ownership:** Janitor AI is a hosted platform where you chat with community-made characters. Your chats live on your own Railway volume here.
- **Model control:** Janitor AI decides the model behind each character. In SillyTavern you choose the Gemini model and tune context size.
- **Where Janitor AI wins:** Its library of community characters is much larger, and you can start chatting without touching an API key.

## How to use SillyTavern Gemini (the OSS LLM frontend)?

Once the service is healthy, this is the path I take for a first session.

1. Create an API key at https://aistudio.google.com/apikey. Click "Get API Key", accept the terms, click "Create API Key", and copy it.
2. Open your SillyTavern URL, click the User account, then the plug icon for API Connections.
3. Choose "Chat Completion" as the API type and "Google AI Studio" as the source.
4. Paste the key into the "API Key" field. It's saved to your volume at /home/node/app/data, so it survives redeploys.

```
API Type:  Chat Completion
Source:    Google AI Studio
API Key:   
```

5. Pick a Gemini model from the selector and click "Connect".
6. Set the context size and safety settings in the connection panel. Menu labels can vary by build, so check what yours shows.
7. Start a chat with Seraphina, then send a message to confirm a reply comes back.

## How to self host SillyTavern Gemini on other VPS Services (SillyTavern self hosting guide)

Self hosting SillyTavern on a plain VPS is a few commands, and the Gemini key goes in through the same UI either way.

### Clone the Repository

Pull the upstream code and check out a release tag so you know what you are running.

```bash
git clone https://github.com/SillyTavern/SillyTavern.git
cd SillyTavern
git checkout release
```

### Install Dependencies

Run the install step once, then again after any upgrade. It pulls the Node packages SillyTavern needs.

```bash
npm install --no-audit --no-fund
```

### Configure Environment Variables

SillyTavern reads config.yaml rather than env vars, so set the listen address and login mode there before you expose the port.

```yaml
listen: true
whitelistMode: false
enableUserAccounts: true
```

### Start the SillyTavern Gemini Application

Start the server, open it in a browser, log in, and add your Google AI Studio key under API Connections with Chat Completion and Google AI Studio selected.

## Official Pricing of SillyTavern Gemini (SillyTavern pricing)

SillyTavern is free and open source under AGPL-3.0, so there is no license fee and no subscription to buy from the project.

## SillyTavern Gemini cloud vs self hosted comparison (Pricing, features, costs, and more)

Running SillyTavern Gemini yourself splits into two bills: the Railway instance and the Gemini tokens you pay Google.

### Monthly cost of self hosting SillyTavern Gemini on Railway

Railway puts one always-on instance at about $5/mo at light use, and this service idles near 150 MB, so you won't hit the top of that range unless you add heavy local extensions.

### System Requirements for Hosting SillyTavern Gemini on a VPS

Plan for about 150 MB idle and roughly 500 MB peak during the first-boot frontend compile.

## Frequently Asked Questions (FAQs)

### Should I use Google AI Studio or Vertex AI?

For most roleplay use, Google AI Studio is easier: create an API key at aistudio.google.com/apikey and paste it in.

### What are the free tier limits?

The free tier caps requests per minute and per day, and the numbers change, so check the quota page in AI Studio before a long session.

### Why did Gemini block or cut off a reply?

Safety filters can block replies, especially dark or explicit roleplay, and the strictness depends on the safety settings you choose in SillyTavern.

### How big should I set the context size?

Set it to the largest value your model supports, then trim it if replies slow down or costs climb.

### Which Gemini model should I pick?

Start with a Flash-class model for fast, cheap replies, and try a Pro-class model when you want stronger memory on long chats.

### Where is my API key stored?

SillyTavern keeps the key on the persistent volume at /home/node/app/data on this Railway template, so it survives redeploys.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/deploy-sillytavern-with-google-gemini
