<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Goutam Mukherji on Medium]]></title>
        <description><![CDATA[Stories by Goutam Mukherji on Medium]]></description>
        <link>https://medium.com/@goutam.mukherji?source=rss-77aab0ea636------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*JLdQkHPUZPchjRQV.jpg</url>
            <title>Stories by Goutam Mukherji on Medium</title>
            <link>https://medium.com/@goutam.mukherji?source=rss-77aab0ea636------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 14:50:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@goutam.mukherji/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Generative AI to create FinOps show back from AWS Cost and Usage Report (CUR)]]></title>
            <link>https://medium.com/@goutam.mukherji/using-generative-ai-to-create-finops-show-back-from-aws-cost-and-usage-report-cur-39c15dba9ce0?source=rss-77aab0ea636------2</link>
            <guid isPermaLink="false">https://medium.com/p/39c15dba9ce0</guid>
            <category><![CDATA[finops]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[aws-cost-management]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Goutam Mukherji]]></dc:creator>
            <pubDate>Sun, 31 Dec 2023 02:05:44 GMT</pubDate>
            <atom:updated>2023-12-31T02:05:44.834Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Generative AI to create graphs on demand from AWS Cost and Usage Report(CUR) stored in S3, using Bedrock, LangChain, Anthropic Claude and Seaborn</h3><p><em>Disclosure: All opinions expressed in this article are my own, and represent no one but myself and not those of my current or any previous employers.</em></p><p>This article is going to focus on two specific areas that are creating all the buzz in the IT world these days — Cloud FinOps and GenAI.</p><p>There has been an explosion in the Cloud FinOps tools and technologies over past couple of years. There are quite a few SaaS providers that have done some impressive work in this space. The cloud service providers also have been busy to solidify their offerings with the enticement of, for a change, <em>reducing</em> cloud spend for their customers.</p><p>One major focus of any FinOps solution is creating different types of graphs and charts for the underlying data around the cost and utilization of the various cloud services to show back relevant metrices to different stakeholders. There is also often a need to create and publish these graphs and charts in a self service mode rather than consume previously created ones, as different business units of the org have a variety of needs in terms of how to visualize the data.</p><p>While thinking about different solution options to address this use case, GenAI seemed to be something worth exploring. After all, GenAI is supposed to create good content based on certain prompts provided the underlying data set is accurate enough.</p><p>Then I pondered upon this wonderfully written blog by <a href="https://medium.com/u/c12cd47b94c9">Diptiman Raichaudhuri</a> — <a href="https://diptimanrc.medium.com/amazon-bedrock-part-4-aws-cost-and-usage-report-cur-summary-from-s3-using-bedrock-langchain-and-cb84b562c894">https://diptimanrc.medium.com/amazon-bedrock-part-4-aws-cost-and-usage-report-cur-summary-from-s3-using-bedrock-langchain-and-cb84b562c894</a>. This creates a summary of the AWS CUR in a nicely written text format.</p><p>Immediately the thought struck that this should be extendable to create graphs and charts. So gave it a try to extend the concept and see the realm of possibilities. The requirement here is to create an API that will return a graph based on the prompt attributes passed on as the query parameters. Of course the API can be further enhanced but that is something for the future :-)</p><p>I updated the Python code to apply the logic of interpreting the prompt, create the graph and return in the response of the API. Used Flask to expose the API. A sample AWS CUR is the underlying data set as provided by the cloud provider.</p><p>Played around with the prompts and zeroed in on something in the lines of “If I want to create a Seaborn bar chart, what would be the x and y axis values for the cost break up by availability zone? Return the response in a JSON format” and passed that prompt along to the Claude model through the Bedrock runtime reference. Then massaged the response JSON and invoked the appropriate Python libraries to create the chart.</p><p>Code snippets to create the charts are as below —</p><pre>import seaborn as sns<br>import matplotlib.pyplot as plt<br>from io import BytesIO</pre><pre>def graph(raw_string):<br>    start = raw_string.find(&quot;```json\n{&quot;) + 8<br>    end = raw_string.find(&quot;}\n```&quot;) + 1<br>    raw_json = json.loads(raw_string[start:end].replace(&#39;\n&#39;, &#39;&#39;).replace(&#39;  &#39;, &#39;&#39;).replace(&quot;&#39;&quot;, &#39;&quot;&#39;))<br>    df = pd.json_normalize(data=raw_json)<br>    sns.barplot(x=df.at[0, &#39;x&#39;], y=df.at[0, &#39;y&#39;])<br>    figfile = BytesIO()<br>    plt.savefig(figfile, format=&#39;png&#39;)<br>    plt.close()<br>    figfile.seek(0)  # rewind to beginning of file<br>    import base64<br>    figdata_png = base64.b64encode(figfile.getvalue())<br>    return figdata_png</pre><p>Voila! The API does return a nicely created graph based on the prompt parameters passed in the API request.</p><p>Will continue to make the API smarter and investigate the accuracy for different types of graphs and charts. Looks pretty promising so far. Will keep you posted!</p><p>Thank you for taking time to read this blog post. Really appreciate it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39c15dba9ce0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>