Skip to content
dhii.ai

AI Product Engineering

Prompt Engineering & LLM Optimisation

Turn inconsistent AI output into dependable behaviour with prompts that are designed, tested and versioned like code.

Prompt audit
3–5 days
Optimisation cycle
1–3 weeks
Team playbook
Included

Inconsistent output is a design problem

When an AI feature gives a great answer one minute and a useless one the next, it usually isn’t the model’s fault. The instructions are ambiguous, the context is incomplete or noisy, the examples contradict each other, or the output format leaves too much room for interpretation. These are fixable problems — with a method.

How we work

We start with failures: real examples where the output was wrong, inconsistent, too long, off-brand or badly formatted. Each failure is diagnosed. Was the instruction unclear? Was key information missing from the context? Did an example mislead the model? Is the task actually two tasks that should be split? Would a different model suit it better?

Then we redesign. Typical changes include separating stable system instructions from per-request data, stating the task and success criteria explicitly, adding a small number of carefully chosen examples, defining a strict output schema, and breaking complex tasks into steps. We test variations systematically against the evaluation set rather than judging by eye.

Structured outputs everywhere

If software consumes the output, the output should be structured. We define JSON schemas or function signatures, use provider features for constrained output where available, and validate everything. Failed validations trigger a retry or a fallback, never a silent error downstream.

Prompts as code

Prompts are part of your product and deserve the same discipline as code: version control, review, separate environments and tests that run before release. We set that up and leave your team a short playbook on writing and changing prompts safely. It’s also a natural topic for a team workshop.

Deliverables

What you get

  • 01

    Prompt audit

    Review of existing prompts, failure examples and model settings, with diagnosed root causes.

  • 02

    Rewritten prompts

    Clear system prompts, task instructions and examples tuned per model.

  • 03

    Structured outputs

    JSON schemas or function definitions so outputs are machine-readable and validated.

  • 04

    Evaluation set

    Test cases that measure the improvement and guard against regressions.

  • 05

    Prompt management

    Versioning, templating and environment separation for prompts.

  • 06

    Playbook

    Guidelines your team can use to write and change prompts safely.

Process

How a prompt engineering & llm optimisation project runs

  1. Step 1

    Collect failures

    Gather examples where current output is wrong, inconsistent or off-tone.

  2. Step 2

    Diagnose

    Identify whether issues come from instructions, context, examples or model choice.

  3. Step 3

    Redesign

    Rewrite prompts and output formats, testing variations systematically.

  4. Step 4

    Measure

    Score against the evaluation set and compare models.

  5. Step 5

    Operationalise

    Version prompts and add evaluation to your release process.

Engagement models

Ways to work together

Every engagement starts with a fixed, written quote. See engagement models & pricing or the rag vs fine-tuning — which does your use case need?.

FAQ

Prompt Engineering & LLM Optimisation: common questions

Is prompt engineering still relevant with smarter models?

Yes, though it has changed. Modern models need fewer tricks, but production systems still depend on clear instructions, the right context, good examples, structured outputs and — above all — systematic testing. That's engineering, not wordsmithing.

Can better prompts replace fine-tuning?

Often. Many teams considering fine-tuning get most of the benefit from better prompts, examples and retrieval. When they don't, the evaluation set we build becomes the starting point for fine-tuning.

Do prompts need to change when we switch models?

Usually somewhat. Models respond differently to the same instructions. With an evaluation set, switching models becomes a measured exercise instead of a gamble.

Can you optimise prompts automatically?

Tools such as DSPy can search for better prompts and examples against a metric. We use them when the task and metric are well defined, alongside human judgement.

Related services

Start a project

Have a workflow that should run itself?

Tell us what you want automated or built. You get a written assessment of feasibility, risks and a fixed quote — usually within two business days.