Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Evincere/klisk/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Description
Deploy your Klisk project to Google Cloud Run with automated setup for Docker, dependencies, and GCP configuration.Subcommands
klisk deploy init
Generate deployment files (Dockerfile, .dockerignore, requirements.txt).
Arguments
Project name or path to initialize for deployment.
klisk deploy
Deploy to Google Cloud Run.
Options
Project name or path. Use
-p as shorthand.Default: Current directory (.)Cloud Run service name. Use
-s as shorthand.Default: Slugified project name from klisk.config.yamlGCP region for deployment. Use
-r as shorthand.Default: Your gcloud default region (if not set, you’ll be prompted)GCP project ID.Default: Your gcloud default project (from
gcloud config get-value project)Deployment Workflow
1. Initialize Deployment Files
- Builds a wheel file from the Klisk package
- Detects if you’re using LiteLLM models
- Creates
.envfrom.env.exampleif needed
2. Configure API Keys
Ensure.env contains real API keys (not placeholders):
3. Deploy to Cloud Run
-
Checks prerequisites:
- gcloud CLI installed
- Authenticated with Google Cloud
- GCP project configured
- Billing enabled
- Required APIs enabled (Cloud Run, Cloud Build, Artifact Registry)
- Proper IAM permissions
- Builds container using Cloud Build
-
Deploys to Cloud Run:
- Copies environment variables from
.env - Configures service as publicly accessible
- Returns the deployed URL
- Copies environment variables from
Prerequisites
Install gcloud CLI
macOS:Authenticate
Set GCP Project
If you have an existing project:- Go to https://console.cloud.google.com
- Create a new project
- Run:
gcloud config set project YOUR_PROJECT_ID
Enable Billing
Cloud Run requires billing to be enabled. Google Cloud offers $300 in free credits for new accounts. Enable billing at:https://console.cloud.google.com/billing?project=YOUR_PROJECT_ID
Required APIs
The deploy command automatically enables:run.googleapis.com- Cloud Runcloudbuild.googleapis.com- Cloud Buildartifactregistry.googleapis.com- Artifact Registry
Examples
Full Deployment Flow
Deploy with Custom Service Name
Deploy to Specific Region
Deploy Different Project
Deploy to Different GCP Project
Service Name Slugification
Cloud Run service names must:- Be lowercase
- Contain only letters, numbers, and hyphens
- Start with a letter
- Be 63 characters or fewer
Environment Variables
Environment variables from.env are automatically set on the Cloud Run service. Placeholder values are skipped:
Deployed:
LiteLLM Detection
The deploy command scans your Python files for LiteLLM model providers:requirements.txt includes klisk[litellm].
IAM Permissions
The deploy command ensures the default Compute Engine service account has:roles/storage.objectAdmin- Access Cloud Storageroles/logging.logWriter- Write logsroles/artifactregistry.writer- Push container images
Troubleshooting
Deployment Failed
If deployment fails, try:- Re-run the command - Permission propagation can take a few seconds
- Check billing - Ensure billing is enabled for the project
- Enable APIs manually:
Build Timeout
If the build times out after 10 minutes:Missing API Keys
If your deployed service returns errors, verify environment variables were set:Permission Denied
If you get permission errors:- Verify you’re authenticated:
gcloud auth list - Check you have Owner or Editor role on the project
- Enable required APIs manually (see above)
Post-Deployment
Test Your Deployment
View Logs
Update Deployment
To deploy updates:Embed Chat Widget
Add the chat widget to your website:Cost Optimization
Cloud Run pricing is based on:- Request time - Pay only when handling requests
- CPU/memory - Allocated resources
- Network egress - Data transfer out
- 2 million requests
- 360,000 GB-seconds of memory
- 180,000 vCPU-seconds
Related Commands
klisk serve- Test production server locallyklisk check- Validate project before deploymentklisk dev- Development environment