Anyone Can Build GenAI Apps
towardsai.net
Author(s): Jiazhen Zhu Originally published on Towards AI. written by Jiazhen Zhu, Michael Pfaffenberger, Wallace Dalmet, Sriram Ranganathan, Ahmed Noufel, and Anveshrithaa SundareswaranPhoto credit: PixabayWe conducted a brown bag session at the Walmart Global Tech Reston site to discuss this topic. We were thrilled to see nearly 100 active participants, both in-person and online. Our aim is that the insights shared today will prove beneficial in your business operations. This blog post is an extension of our session, intended to reach a larger audience. The objective is to guide the reader through the journey from conceptualization to development and, finally deployment, enabling you to build your own GenAI Apps.AgendaGenerative AI2 WHY? & 1 HOW?How to find an IDEA?Data ScientistData AnalystSoftware EngineerSummaryGenerative AISource: MicrosoftGenerative AI is currently a trending and highly-discussed topic. Its on everyones lips, indicating its growing importance in the tech industry. Of course, not everyone may agree with the presented diagram above, but it provides a broad perspective, offering a birds eye view at a height of 10,000 feet. It delineates the differences, making it an important tool for understanding this complex topic.2 WHY? & 1 HOW?Anyone can build GenAI apps!Today, we are focusing our discussion on the idea, Anyone can build GenAI apps. We chose this topic not only for its potential to engage people but also because we believe it to be true. Almost everyone on our team has developed a GenAI app, contributing significantly to our organizations success.This may provoke questions such as, Why anyone? or Why specifically GenAI apps? and most importantly, How can we make this possible? These are valid inquiries that deserve comprehensive exploration. In our discussion, we will delve into each of these questions, providing thorough explanations backed by our insights. We aim not just to answer these questions, but also to empower each participant with the knowledge and understanding of GenAI app development.1. WHY Anyone?Since we all share a common language, which for most of us is English, it plays a significant role. The Language Learning Model (LLM) model accepts inputs in natural language, and English is one of them. When these elements are brought together, English essentially transforms into a programming language.Imagine being a data scientist with a deep understanding of Machine Learning models, but needing assistance with User Interface (UI) development. In such cases, the LLM could prove to be an asset, aiding in the creation of a functional UI.Similarly, if youre a software engineer with a vast array of functions in your code repository, LLM can assist in the development process. It can help identify the appropriate function, extract the necessary parameters, and trigger the function, thereby streamlining operations.Moreover, for data analysts, LLM can offer a wide spectrum of data insights. It acts as a versatile tool that helps in interpreting, analyzing, and deriving significant patterns from intricate data sets. Therefore, LLM can essentially function as a valuable companion in your professional journey, irrespective of your role in the data science field.2. WHY GenAI and App?GenAI holds significant potential, similar to the surge of mobile apps we saw 1015 years ago, as illustrated in the chart below. In the mobile realm, the chipset was fundamental to smartphone development. From this base, we built an operating system, that allows numerous developers to quickly and efficiently create mobile apps.The same principles apply to GenAI. The LLM is crucial to GenAI. With the LLM, we can establish the GenAI infrastructure as our foundation, facilitating the creation of various GenAI apps.Photo credit: Jiazhen ZhuYou might wonder why we focus on GenAI apps instead of LLM if the latter is so essential. The reason is that the entry bar for LLM is high. Currently, there might be roughly 100 researchers capable of creating an LLM from scratch, including pre-processing, model training, and post-processing. In contrast, GenAI apps are much more accessible, making them an easier entry point for most people.3. HOW can we achieve the GOAL?Based on the information provided, its clear that most components fall under either an LLM or are foundational elements that are already established. For instance, the component RAG refers to Retrieval-Augmented Generation, a framework that we already have implemented.Similarly, Function Pools pertains to the collection of functions or SQL templates that are pre-existing within our code base.Additionally, whenever a requirement for a new LLM or Pre-Trained Model arises, Hugging Face is a valuable resource. Hugging Face is essentially a repository for model searching, making it a convenient platform for finding the needed LLM/Pre-Trained Model.Photo credit: Jiazhen ZhuThe three key elements we need to focus on are:Prompt: The users guideline will be fed into the model as input.Basic Logic: This involves a few lines of code that bridge the gap between the Prompt and the LLM. An example of this is the process of calling the RAG.Web App/Platform: few lines of code for UIHow to find an IDEA?Typically, GenAI utilizes LLM to extract or generate structured information from unstructured data. By employing RAG, we can acquire the appropriate information that aids decision-making.Photo credit: Jiazhen ZhuIf youre dealing with unstructured data and looking to convert it into structured insights for more informed decision-making, its an ideal opportunity to harness Generative AI for automation and optimization.Unstructured dataSource DataHuman CommandStructureRaw Code/SQLFunction with ParametersSQL Template with ParametersTablesDecision MakingDashboardDirect ResponseFunction TriggerThe Open Source AI StackPhoto credit: Byte Byte GoData ScientistAs a data scientist, your primary focus is often on developing LLM or ML models. However, deploying these models into real-world applications is usually not part of your core responsibilities. Fortunately, the industry now offers easier ways to build UI applications with ML or LLM backends, using tools like Streamlit.For instance, if youre working on a Named Entity Recognition (NER) app, Streamlit allows you to create a functional interface with just a few lines of Python code making development simpler and more accessible than ever.# this the function for sentimentdef sentiment_analysis(input): tokenizer = AutoTokenizer.from_pretrained("your_model") model = AutoModelForTokenClassification.from_pretrained("your_model") nlp = pipline("ner", model = model, tokenizer = tokenizer) ner_results = nlp(input) return ner_results# Streamlit UI functiondemo = gr.Interface( fn = sentiment_analysis, input = gr.Textbox(placeholder = "Write your text here...") outputs = "text", examples = [["Please check here"]])demo.launch(server_name = "your_ip", share = True, server_port = 8502)Data AnalystAs a data analyst, your primary goal is to uncover insights from the data you have. The key to success lies in how effectively you analyze it. But what if you could leverage an LLM-powered application to dive deeper into small datasets? The good news is yes, its possible! Building such an application is not only feasible but also straightforward with minimal coding effort.# if we have one function (get_response_from_llm) which can get the response from LLM# create one function feed the promptdef query(data, query): prompt = f""" You are an expert Data Analyst, given the following data, answer the corresponding questions: Data: {data} Question: {query} """ output = get_response_from_llm(prompt) return output# Streamlit UI functiondemo = gr.Interface( fn = query, inputs = inputs, outputs = outputs )demo.launch(server_name = "your_ip", share = True, server_port = 8502)Additionally, we can develop a Text-to-SQL application that allows analysts to fetch data easily by simply inputting natural language queries. This eliminates the need for complex SQL knowledge and accelerates data exploration, enabling faster decision-making.Software EngineerFor software engineers, writing code is their core responsibility, and its something they excel at. However, Gen AI applications can significantly enhance their productivity by helping them efficiently reuse previously written code and functions.For instance, engineers can store all their function code in a vector database, accompanied by well-defined comments and documentation. With the power of semantic search and function calling, a GenAI-powered app can intelligently identify the most relevant functions and automatically trigger the appropriate components within the development pipeline.This approach not only streamlines development workflows but also reduces redundant coding efforts, accelerates project timelines, and ensures consistency across projects by leveraging existing solutions effectively.SummaryThe insights shared during our session and in this blog post are designed to help you understand and leverage the potential of GenAI. By following the outlined steps and utilizing available resources, you can embark on your journey to develop GenAI applications that enhance your business operations.Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming asponsor. Published via Towards AI
0 Yorumlar ·0 hisse senetleri ·46 Views