Prompt Writing Best Practices
Validated on 27 Apr 2026 • Last edited on 27 Apr 2026
Inference provides a single control plane for managing inference workflows. It includes a Model Catalog where you can view available foundation models, including both DigitalOcean-hosted and third-party commercial models, compare model capabilities and pricing, use routing to match inference requests to the best-fit model, and run inference using serverless or dedicated deployments.
Effective prompts guide the foundation model to accurate, relevant responses by ensuring specificity, context, and intent, similar to asking well-structured questions to a support team.
When interacting with the model, well-designed prompts identify training gaps, refine responses, and improve accuracy and consistency, enhancing the user experience.
Maintain a Neutral Tone
When writing prompts, maintain a neutral tone and avoid sarcasm or figurative language. Sarcasm or figurative language may confuse the model, leading to literal but unhelpful responses. A neutral tone ensures concise, balanced, and unbiased answers.
Maintain neutrality by:
- Using direct, straightforward language.
- Replacing figurative expressions (for example, metaphors, idioms, sarcasm) with literal statements.
- Avoiding emotional language or biased terms.
| Prefer | Avoid |
|---|---|
Summarize the key points of the generative AI article accurately. |
Can you summarize the main points of this article about generative AI? |
Ask Intentional Questions
When asking questions, make them explicit, concise, and tailored to your needs. Avoid vague or broad phrasing to ensure accurate and actionable responses.
Ask intentional questions by:
- Providing clear context for the model to focus.
- Including desired outcomes or format, like a code snippet, step-by-step instructions, list, or paragraph.
- Indicating the level of detail needed, such as a brief overview or detailed explanation.
- Adding relevant background information for context.
| Prefer | Avoid |
|---|---|
Explain how I can improve the accuracy of my model, specifically through hyperparameter tuning. |
Can you explain how I can improve the accuracy of my model? |
Limit Prompts to One Question
When writing prompts, ask one question at a time and avoid combining multiple questions in a single prompt.
Compound questions can confuse the model, leading to incomplete or skipped answers. Simple, focused prompts ensure direct and relevant responses.
| Prefer | Avoid |
|---|---|
“What is RAG?” After receiving the answer, follow up with, “How is RAG useful? |
Can you explain what RAG is, and also tell me how it is useful? |
Separate Complex Prompts
If your prompt is complex, divide it into smaller questions to guide your model effectively toward the desired answer.
Separating complex prompts ensures specific, accurate, and complete responses while avoiding vague or partial answers. It also helps address each part of your query systematically.
Separate complex prompts by:
- Identifying the components of the prompt and creating smaller, focused questions for each.
- Starting with foundational questions to gather background information before addressing the main topic.
- Using a step-by-step approach to cover different aspects of the query and combining the answers for a complete response.
| Prefer | Avoid |
|---|---|
|
How do I create, train, and evaluate a model for text generation? |
Add Examples or Screenshots
When writing prompts, add examples or screenshots if the question alone might confuse the model.
Examples or screenshots provide context, clarify your query, and help the model understand the situation or desired outcome.
Use examples or screenshots to improve prompts by:
- Showing the response you want with an example or screenshot.
- Highlighting incorrect outcomes to help the model avoid them.
- Including step-by-step examples or screenshots to illustrate issues, such as an error in a script.
- Demonstrating how specific inputs should produce specific outputs.
| Prefer | Avoid |
|---|---|
I tried running a Python script (see the attached screenshot), but I keep getting a ‘TypeError: unsupported operand type(s)’. Could you help identify the cause of this error? |
I tried running a Python script, but I keep getting a type error. |