Skip to main content

Command Palette

Search for a command to run...

Prompt Engineering

Updated
1 min read
M

Senior DevOps Engineer with a strong background in CICD and Observability and Monitoring and skilled in tools like Elasticsearch, Docker, Kubernetes,Terraform, and Ansible. I focus on automating using DevOps tools or scripting using shell and python.

Better way of Framing an input for GenAI model to get desired output by reducing the cost

input/prompt ——> AI model ——> desired output

Good prompt significantly reduce the cost?

  • Get Kubernetes deployment/service → Python → Generate

  • Prepare prompt

  • API call to LLM (OpenAI, Deepseek)

    • (API calls are not free)
  • Bad prompt/input generates more tokens/words

  • Number of tokens(response words) increases price

Zero Shot prompting:

Provide a prompt without any example

  • general version:Generate a kubernetes manifest for deployment resource

  • better version:Generate ONLY kubernetes manifest for deployment resource

Few Shot prompting:(recommended)

provide examples

  • Example: Create a name which starts with N

  • Answer: Name for alphabet N is Nani

  • Example: Fetch the Docker version

  • Answer:

      #!/bin/bash
    
      #######
      # Author:
      # version
      # date
      #########
    
      docker --version
    
  • Fetch the versions of all the processes that are installed on the machine

Multi shot prompting:

provide more examples

COT (chain of thoughts):

  • Enhances the performance of LLM (Reasoning)

  • using chain of thoughts we can derive best results from LLMs with resoning capability

Strategy to use prompt. engineering:

  • Provide context

  • Provide the instruction

  • Provide examples (few shot prompting)

  • Define output format

14 views