The Wine Glass Model : GenAI Application Ecosystem
Tags: learning, ai
Published: 2024-05-04 23:20:36

**Prelude**
Some years ago, I watched a movie called "[I, Robot.](https://en.wikipedia.org/wiki/I,_Robot_(film))" Later, someone told me it came from a [book](https://en.wikipedia.org/wiki/I,_Robot). So, I got the book and read it. This book talks about robots and AI from a very deep and thought provoking mindset. In the story, there are rules for robots. [Three Laws (rules)](https://en.wikipedia.org/wiki/Three_Laws_of_Robotics) for robots as defined by Isaac Asimov in this book are,

**First Law:** A robot may not harm a human or, through inaction, allow harm to come to a human.

**Second Law:** A robot must obey orders given by humans, except where it conflicts with the First Law.

**Third Law:** A robot must protect its own existence, as long as it doesn't conflict with the First or Second Law.

These rules make you think about big ideas, like what is right and wrong. The book also shows robots as smart and having feelings. This is interesting because we usually think of robots and AI as just machines. The movie is good, but the book makes you think even more. It makes you wonder about life and **what it means to be alive, even for a robot.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zttdtuxmoysdeeoit0sa.png)
CH9 👉[here](https://www.linkedin.com/pulse/ch9-ai-powered-requirements-analyzer-vishal-mysore-vjcee%3FtrackingId=j%252BhCNxMtqt6k2kFZcNvxHQ%253D%253D/?trackingId=j%2BhCNxMtqt6k2kFZcNvxHQ%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BMEYJUtS9RHOcF8KVDvlW5w%3D%3D). CookGPT 👉[here](https://www.linkedin.com/posts/vishalrow_im-thrilled-to-announce-the-launch-of-cookgpt-activity-7154863281965305856-3S0M?utm_source=share&utm_medium=member_desktop&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BMEYJUtS9RHOcF8KVDvlW5w%3D%3D). New to AI? 👉 [here ](https://www.linkedin.com/pulse/your-first-llm-experiment-vishal-mysore-j55ec%3FtrackingId=TLhdaWEtw8gNUPnoZYKsNw%253D%253D/?trackingId=TLhdaWEtw8gNUPnoZYKsNw%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BMEYJUtS9RHOcF8KVDvlW5w%3D%3D).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zttdtuxmoysdeeoit0sa.png)




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9zsfrqt2j0xyncsiyg8.png)



**Overview**
Developing AI apps involves several important aspects:

**Foundation Model:** It's like a starting point for AI. This model already knows many things from big data. Examples are GPT and BERT. We use it to build more specialized models. To know more click [here](https://www.linkedin.com/pulse/llm-models-encyclopedia-vishal-mysore-zjn6c?trackingId=heZCsL0PSBqbDk6cZDelkg%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_recent_activity_content_view%3BTTkLPlHbT4OBWAuyACUmpw%3D%3D&).

**Prompt Engineering:** We tell the AI what to do with specific instructions called prompts. This helps it understand what we want. This is the left part of the wine glass and we will go over this in detail.

**Fine-tuning:** We make small changes to the model to make it work better for a specific job. It's necessary to get the best results. For step by step guide to fine tune click [here](https://www.linkedin.com/pulse/fine-tuning-open-source-language-models-step-by-step-guide-mysore-oi7cc?trackingId=2DhcQdB1Ro6EXOaTscJ3PA%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_recent_activity_content_view%3BTTkLPlHbT4OBWAuyACUmpw%3D%3D&)

**RAG (Retrieval-Augmented Generation):** This makes AI better at writing by combining knowledge from different sources. It's useful when AI needs more information to give better answers. This is the right part of the wine glass.

**Response Validation:** Click here to know more about Hallucination. To know more details on how to avoid [Hallucinations ](https://www.linkedin.com/pulse/genai-hallucination-practical-example-vishal-mysore-l353f?trackingId=2DhcQdB1Ro6EXOaTscJ3PA%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_recent_activity_content_view%3BTTkLPlHbT4OBWAuyACUmpw%3D%3D&) and toxicity click [here ](https://www.linkedin.com/pulse/detect-ai-hallucinations-rag-routing-branching-chaining-vishal-mysore-jrzic?trackingId=2DhcQdB1Ro6EXOaTscJ3PA%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_recent_activity_content_view%3BTTkLPlHbT4OBWAuyACUmpw%3D%3D&). This is the bottom part of the wine glass

**Governance and Monitoring.** The entire wine glass model is immersed in [governance and monitoring aspects](https://www.linkedin.com/pulse/deadly-simple-guide-ai-development-hands-on-examples-vishal-mysore-1rc2c/?trackingId=EwrhSpUTSwKvJBS%2BM10jqA%3D%3D&lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BMEYJUtS9RHOcF8KVDvlW5w%3D%3D), signifying the overarching framework that ensures responsible and ethical AI usage throughout every dimension.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kq4vs0x5rcsrt0a9ju0b.png)
Want to write AI application in pure Java? 👉 click [here](https://www.linkedin.com/pulse/ai-application-made-100-java-vishal-mysore-0ozcc/?lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3BMEYJUtS9RHOcF8KVDvlW5w%3D%3D)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kq4vs0x5rcsrt0a9ju0b.png)



## Prompt Engineering - Left side of the Wine Glass

Most of us are already familiar with PE but here I would discuss some of the advanced concepts with examples. Few of the open source tools you can use for prompt engineering are Manifest , Promptify and Chainforge

Lets look at how I am doing it in my CookGPT project. 

**Prompt Selection** : Prompt selection involves choosing the most appropriate prompt from a set of candidate prompts for a given task or input query. Prompt selection methods may rely on custom rules, or user feedback to determine the optimal prompt for maximizing task performance.

```
User : I want a recipe for vegetable biryani


Mapped Prompt : Generate a classic recipe for Vegetable Biryani, including ingredients and step-by-step cooking instructions. Also provide calories and serving instructions.
```

**Prompt Compression :** Here the goal is to reduce the length and complexity of prompts without sacrificing the quality or relevance of model outputs.

```
User: Hey, I was wondering if you could maybe help me out with something? I'm craving a dish right now, you know? It's like, this Indian thing, with paneer and some kind of sauce, I think. Do you think you could give me a recipe for that?


Compressed Prompt : Requesting Indian paneer dish recipe.
```

...continue reading the article for free [here](https://www.linkedin.com/pulse/wine-glass-model-genai-application-ecosystem-vishal-mysore-b0n8c/?trackingId=DuueMqYLTGCdLrjg0Wkr%2Bg%3D%3D)