Skip to content

Promptlandia

Stop guessing and start engineering your prompts! Promptlandia is a powerful web application that helps you analyze, refine, and improve your prompts using AI-powered feedback. Whether you’re a seasoned prompt engineer or just getting started, this tool will help you get better results from your generative AI models.

Promptlandia Demo

  • Prompt Improvement: Submit an existing prompt and get an improved version generated by a powerful AI model.
  • Prompt Health Checklist: Evaluate your text prompts against a comprehensive checklist of best practices and receive detailed feedback on potential issues.
  • Video Prompt Health Checklist: Evaluate your video prompts against a checklist of best practices for video generation.
  • Prompt Trimmer: Reduces prompt size by removing generic LLM best practices while preserving core task-specific instructions.
  • Playground: Experiment with different prompts and models in a simple and intuitive interface.
  • Settings: View the underlying prompts used by the application for full transparency.
  1. Improve a Prompt: Go to the ‘Promptlandia’ page. Enter your original prompt in the text boxes and describe the improvements you’d like to see. Click ‘Improve Prompt’ to get a revised, optimized version.
  2. Check Prompt Health: Go to the ‘Checklist’ page. Paste your prompt and click the ‘Evaluate’ button to get a detailed analysis of its quality against proven best practices.
  3. Check Video Prompt Health: Go to the ‘Video Checklist’ page. Paste your prompt and click the ‘Evaluate’ button to get a detailed analysis of its quality against best practices for video generation.
  4. Trim a Prompt: Go to the ‘Trimmer’ page. Enter a verbose prompt and click ‘Trim Prompt’ to remove generic instructions while keeping the core task requirements.
  5. Experiment: Use the ‘Playground’ to freely experiment with different prompts and model settings.
  1. Create a .env file: Use the .env.dotenv file as a template to create a .env file in the root of the project. This file should contain your GCP project information.

    Terminal window
    cp .env.dotenv .env
  2. Install dependencies and run the application:

    Terminal window
    uv sync
    source .venv/bin/activate
    mesop app.py

The application is configured using environment variables, which can be set in a .env file in the project root.

VariableDescriptionDefault
PROJECT_IDYour Google Cloud Project ID.(Required)
LOCATIONThe Google Cloud region for Vertex AI.us-central1
MODEL_IDThe primary Gemini model ID used for generation and improvement.gemini-3.1-pro-preview
PLANNING_MODEL_IDThe model ID used specifically for the “thinking thoughts” (planning) step of prompt improvement.Defaults to MODEL_ID

Promptlandia also provides command-line tools for its core functionality. These can be run using uv run.

For detailed usage instructions and examples for all available tools, please refer to the CLI README.

Trim a prompt:

Terminal window
echo "Your verbose prompt here..." | uv run cli/trim.py

Improve a prompt:

Terminal window
echo "Write a story about a dog." | uv run cli/improve.py -i "Make it sci-fi."

Check prompt health:

Terminal window
echo "Write a poem about a cat." | uv run cli/checklist.py

Create a service account (once)

Terminal window
export PROJECT_ID=$(gcloud info --format='value(config.project)')
export DESC="promptlandia"
export SA_NAME="sa-promptlandia"
export SA_ID=${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com
# create a service account
gcloud iam service-accounts create $SA_NAME --description $DESC --display-name $SA_NAME
# assign vertex and cloud run roles
gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:${SA_ID}" --role "roles/aiplatform.user"
gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:${SA_ID}" --role "roles/run.invoker"

You may choose to deploy this either unauthenticated or authenticated with Cloud Run IAP.

Terminal window
export PROJECT_ID=$(gcloud info --format='value(config.project)')
# The SA_ID is the email address of the service account created in the previous step.
export SA_ID=sa-promptlandia@${PROJECT_ID}.iam.gserviceaccount.com
Terminal window
gcloud run deploy promptlandia --source . --service-account=$SA_ID --region us-central1 --set-env-vars PROJECT_ID=$(gcloud config get project),MODEL_ID=gemini-3.1-pro-preview,LOCATION=us-central1 --allow-unauthenticated
Terminal window
gcloud alpha run deploy promptlandia --source . --iap --service-account=$SA_ID --region us-central1 --set-env-vars PROJECT_ID=$(gcloud config get project),MODEL_ID=gemini-3.1-pro-preview,LOCATION=us-central1

Utilize the gcloud alpha iap web add-iam-policy-binding to manage user/group access for IAP.

Terminal window
# group: Google Cloud Applied AI Engineering (mock email)
gcloud alpha iap web add-iam-policy-binding --member=group:cloud-aaie@google.com --role=roles/iap.httpsResourceAccessor --resource-type=cloud-run --region=us-central1 --service=promptlandia

If you’re interested in contributing to the project, understanding the architecture, or learning how to add new tests, please see our Developer’s Guide.

This is not an officially supported Google product.