# Vikrant Khedkar — Writing # Spending money on GPU's was my best investment The best investment I made wasn't in stocks, crypto, or day trading. It was spending money on GPUs to learn how LLMs work Have you ever tried deploying a model yourself? Not just used an API. I mean actually fine tuned a model, set up your own inference pipeline, and deployed an open weight model from scratch. A lot of people never get to do this, not because they lack curiosity, but because they lack access to powerful GPUs. I started with what I had: my laptop's GPU. And honestly, it was terrible. Fine tuning a model on it was painfully slow. But that was my starting point. Later, I moved to Google Colab. I completely pushed its limits too, but I was still able to fine-tune a Phi-2 model. That experience gave me my first real taste of what hands on LLM work actually feels like. Then I discovered RunPod. For the first time, I had access to powerful GPUs. I added some money to my account and used those GPUs to train models. That was one of the biggest leaps in my learning journey. Suddenly, I could move between epochs at a speed I had never experienced before. I also deployed an open-weight model on Modal using their initial free credits. That helped me understand how to set up my own inference pipeline instead of just depending on hosted APIs. Later, one of my friends had to work on a thesis project for their final year of engineering. I helped them with it, and that gave me another opportunity to work hands-on with RunPod GPUs. I created datasets, fine-tuned models, and learned even more by actually building. Through all of this, I started understanding things that no classroom had taught me properly: - How tokenization works. - Why every model has its own tokenizer. - How model size affects capability. - How LoRA and QLoRA work. - What actually happens when you quantize a model. - Why smaller models can be efficient, but also come with trade-offs. It was beautiful. I was learning at a completely different level not through a roadmap, not through a course, and not through formal education. Just curiosity, experiments, failures, and hands-on building. I even tried incorporating these learnings into hackathon projects, and the knowledge has compounded over time. It still helps me to this day. The reason I'm writing this is simple: Many people wait for the perfect roadmap. The perfect laptop. The perfect course. The perfect time. But in reality, you start with what you have. Spend some money on tools that help you learn. That money is not an expense it is an investment in your skills. And in my opinion, it gives far better returns than wasting money chasing quick wins. I'm still learning and building. If you relate to this journey, or if you have thoughts, questions, or your own experience with fine-tuning and deploying models, I'd love to hear from you in the comments. ps: its a image of me hacking on a side project trying to train a U-net model. --- # AI has agency where is yours? Claude code is going of the roofs with opus 4.6 AI coding has reached a stage at which where you can just prompt away what you want and it does build a really good solution for you, all you need is a claude max sub of 100$ ( dayum it never reached the rate limit). This is scary the skill we all have been learning all these years called coding is changed forever. Now its time to adapt quickly or stay behind. ## How to adapt 1. **Improve your vocab** We use english language to prompt claude code we since this is related to coding and computer science you should be really good with the vocab and the words in the field of computer science, because if you have vision of something that you want built but don't have a right way of putting it into words claude code will build it for you but it wont be on point. So build your dictionary of words & concepts so that you can pin point what you want. This is where years of learning coding and computer science differentiates you from pure vibe coders, you know the "language" of the machines as well humans. But this is a tricky place to be in the engineers who were 10x will now become 100x so things are not as levelled as you think. 2. **Try to build large complex projects with AI** Building complex projects with AI will help you understand the reach of these AI models, if you were a generic i don't even remember the word, let me remember yes found it a MERN stack dev , a backend dev then AI is no more around the corner , it has blasted the door and has infiltrated your house and is probably playing PS5 at your home while its sub agents are building shit for you. So you need to be on the edge see its limits with your own eyes and you will be less scared, solve hard problems , watch it struggle. Build something complex. 3. **let ai be ai you be you** Don't be a traditional engineer now, you are a human bring the human side to the whole process of building products. Know what is actually useful, understand the users problem , listen and then build that solution either hand code it vibecode it or co write it with AI it doesn't matter, delivery of the solution and talking to users is your thing. Be at cross sections of fields , get good at talking to people , organizing events. 4. **AI has agency where is yours?** Now you no longer can stay up in your corner in the world just fixing backend issue or fixing css on the webapp. No. you need to get out , take initiatives, no matter if you are a engineer or non tech everyone can build now. What matters is who can build a stable, clean and actual usable software and get feedback on it , keep iterating on it till its a freaking good product. This includes having good Design taste, understanding of design principles, what is trending, security principles, handling boring stuff like marketing, writing emails to users and clients.You need agency. If before someone else was laying out the tasks for you ,then you are no longer needed ,even the person who was giving you the task isn't needed, rather someone who knows what needs to be built and has the agency to take it completion and launch it will replace you both. If you have that agency then you can be friends with agents else you are fucked 5. **Spend money on AI** CEO of notion says we take pride in amount of tokens burned it is not money wasted but things we learned. By the moment you start analyzing the p&l from a AI tool , you are already behind. So spend on it try as much tools / models as possible , its like having a computer in 90's or early 2K's those who were on the edge built great things, get in the arena try things , this is not spending this is investing. 6. **Spend some time outside AI** Sounds counterintuitive but yes the time you spend outside your work is the real you , eventually everything can be automated , that identity of you as a coder or builder will be erased someday. So who are you if all of that is taken away from you. What do you like to do. What is your taste in art , music , movies. Can you walk silently in nature, look at night sky and just wonder and smile. Have you ever asked the question who am I? ever dabbled yourself with spiritual wisdom of Gita,Quran or Bible. Do that as well that is real you. Everyone is clueless Yes everyone is clueless so try your best, learn , save, invest ride the wave. Build other skills on the side as well. --- # AI IDEs and agents I used this year I started with Cursor as my first AI IDE, used it for a year. For the last 3-4 months switched to Claude Code but I am back to Cursor now. ## Why I switched to Claude Code? Cursor had problems working with large react components it failed miserably when working with large react codebase. Claude Code made it easier to do this, everything fit in right in the context and worked, I was able to get my tasks done, but it was slow. Between this for a brief period of time I was in love with Windsurf but it just didn't deliver, app was laggy and became slow for me I loved their browser feature. And now again I'm back on @cursor_ai. They have cracked something, they are doing something right, it's faster than before the agent is making concise changes now than huge refactors. It just works. Also for a week tried using Codex too but damn its slow and I mean very slow. But I got it as perk with ChatGPT subscriptions thats why I gave it a go. For now Cursor is still winning and it is my daily driver. I have also matured in ways I use these AI tools than blindly prompting to fix things. I treat them as pair programmers and we work through problems together. I will write about it in some other post. But right now cursor wins. I feel sad for what happened with Windsurf I really loved the way they provided a set of icons to choose from --- # Improving LLM Workflow Evaluation: How to Sidestep Common Mistakes Improving AI Workflow Precision Using Tailored Validations and Scoring Methods ## Why is it problematic? To make your RAG pipeline or agent accurate and avoid hallucinations we need some metrics to verify the output of the agent. LLM as a judge is one of those methods which can be used with multiple strategies and most common one is to give a score to the generated content in integers (eg. rate the response on a scale of 1-10 for given criteria). The issue is that the broader scope we leave for the LLM and give it many token options, the more likely it is to hallucinate and fail. Here we are telling the LLM to rank the output on a scale of 1-10 (suppose we are ranking the summary of a transcript), then it will do some reasoning and give results based on your prompt, but there is no solid methodology backing this. This will be different each time, but that's not the issue. The issue is the gap between these results is so sparse. This makes it even more important to have solid validation of your AI responses and generated content. We can't rely on numbers like this. In some cases, a simple 0 or 1 (binary validation) might work where the task is simple, but RAG pipelines and AI workflows (agents) aren't simple these days. They are customized to the business need and what the user wants. Based on that, they have different problems that need dedicated solutions for the particular scenario by considering the context. Unlike engineering principles, we still don't have universal patterns for AI workflows. We need to tailor to the needs of the business. But still, there are certain learnings from the community that we can use to better improve the workflows. So if this isn't the way to validate, what should we use? Now let's discuss it in detail in the next section. ## Custom validations and using rubrics As I said above ai workflows needs to be very specific to the business needs and have specific requirements for which we might not have have some universal patterns or solutions. So in such cases we need to implement custom validations based on the requirement and instead of using numerical response for ranking the response we can use rubrics based approach. let's take a consider the above example of transcript summarization, initially we were just summarizing the transcript and passing it to a LLM as a judge to rank the response on a scale of 1-10. Now lets think of a different more efficient approach. We will now first generate a quiz long answers based on the the transcript of the call. Quiz - Questions : Answer This will contain a key value pairs which will contain a quiz for the judge to take when ranking the summary. Once the summary is generated our LLM as a judge node will try to solve this quiz based on the generated summary, based on this we will get a more solid and accurate idea of how well the summarization worked. Then we can score based on how many questions it was able to answer. ### What's the difference? If you look at the the second approach the scores it will give a solid proof which justifies the score rather than the first approach which just relies on the system prompt and reasoning of the llm. This is just a one example tailored towards the transcript summarization, there are diffrent scenarios that need different solutions tailored towards them. Lets take one more example, suppose you are working on a extraction pipelien which takes multiple pdf's and docs embeds them and later you are going to extract information about the employees, your pipeline may extract data like Name, Department, Joining data, team , email etc. So in such scenarios one effective solution is to first understand the set of constants that you have, here the Department is a constant set of items, the employee will always belong to one of the predefined items in the list called [Department]. This list includes specific departments within the organization, such as Human Resources, Marketing, Sales, Engineering, and Finance. By having a fixed set of departments, it becomes easier to categorize and organize employee data accurately. When extracting information, the pipeline can quickly identify which department an employee belongs to by matching it against this list, for matching this we wont rely on the LLM, we can use deterministic code to get the structured output generated by the LLM and just match it against the available list of Departments. This ensures consistency and reduces errors in data processing, making the extraction process more efficient and reliable. ### Don't always rely on LLM's for validations > Use deterministic code validations Just like we saw in the above example we can use simple techniques like these to better valiate the LLM responses. We can leverage our classic deterministic code pipelines for fine grained validations like these on multiple areas of the LLM generated output. This really improves your workflow into a solid tollerant system. Above I mentioned about rubrics based validation I think Ill discuss about it in a dedicated post. --- # 2 Simple tips for making your Langgraph agent Production ready LangGraph is a great framework that allows you to develop agents while keeping you in control of prompts and routing. If you are done building your agent and running it in Python Notebooks and want to put in production there are somethings that you need to follow. Prototyping and running your first agent is straightforward, but minor oversights during production deployment can lead to major consequences. So here are two simple tips to help you make your langgraph agent production ready. ## 1. Make your Agent Async By default, the agents are synchronous (sync), which makes them unable to process multiple requests simultaneously. Langgraph allows you to make your agent asynchronous (async) by using the async and ainvoke. async is self explanatory which makes a given node which is a simple python function async on the other hand hand ainvoke just prefixes 'a' in invoke which is used to invoke your agent in async mode. So if you are going to put your agent in production making your agent async is the first thing you should do. If you don't want your agent to stall and want your system to handle multiple requests you should make your Graph async. Making your graph async is really simple, you have to make all the nodes in your graph as async with 'async' keyword. ```python async get_price(state:AgentState) -> AgentState: pass ``` Then when invoking the graph you have to use ainvoke which is asynchronous invoke instead of just invoke along await. Don't forget the await ! Please look at the example below ```python await graph.ainvoke( input={ "messages": [HumanMessage(content="""Find the me price of Mustang GT""")] }) ``` Just by making a simple change to your graph , you will have a better agent. ## 2. Use Runtime Configurations Runtime configurations is also another powerful setting you can use in your LangGraph agent which will give you a lot of flexibility over the graph. If you want to enable the ability to adjust certain configurations of the graph while it is running, you should consider using the Runnable Config feature. This feature provides significant flexibility, allowing you to modify various parameters and settings of your LangGraph agent on the fly. By doing so, you can adapt the behavior and performance of your agent to better suit different operational conditions and requirements without needing to stop or restart the entire system. This capability is particularly useful in dynamic environments where the demands on your agent can change frequently, ensuring that your system remains responsive and efficient. For example, you might want to be able to specify what LLM or system prompt to use at runtime, _without polluting the graph state with these parameters_. Look at the example below to see how it works ```python #1 Define a config and pass the values that you want to send at runtime config = { "configurable": { "model": model, "tone": happy } } await graph.ainvoke({}, {"configurable": config}})) ``` By making use of configurations you can modify the agent settings on the fly making it more dynamic. These two straightforward tips can significantly enhance your agent's performance, but there is potential for even more improvements. By making scenario-specific adjustments and modifications, you can address particular challenges and further refine the agent's capabilities. This approach allows you to tailor the agent to better meet the unique demands of different situations, ultimately leading to a more effective and efficient system. Thanks for reading! --- # Data Flywheel in agents Data flywheels are very important if you are building agents in production. If you have live users using your agent having a proper data flywheel in place is really crucial. ## What is a data flywheel? Data flywheel is a self-reinforcing loop that uses the data that you have gathered via logs or user feedback to continuously improve and adapt the product for better usability and accuracy. Its basically a feedback loop that you implement in your product development lifecycle. It is mostly used in live products. Its a important facet that you have to consider to keep the product error free and easy to use for the users. ![image credits - Jason Liu](https://miro.medium.com/v2/resize:fit:1400/1*BYLjHBFAEscnb_G1Kt91Pg.png) ## Data Flywheels in AI Agents AI agent is just classical piece of software paired with token predicting language models called LLM's. Though mostly the ideas and concepts used while building the agents are similar to the traditional softwares, there are some major differences, the classical software is mostly Deterministic on the other hand software powered by AI is non-deterministic. We need data flywheels for these agents too to keep them error free, and as easy as possible to use for the users with lesser friction. For any data flywheel to provide us value, the most important thing we need is data. ## Data points to use In agents there few sources that you can utilize to collect this data for your flywheel, here some examples: 1. Tracing Logs: If you are using something like langsmith or langfuse to trace your llm calls and chain , data at each step is captured on these platforms. You can use this data to better understand whats going under the hood and how do different models perform for different nodes or use cases. It also allows you to look at the time it took for each call. 2. Failed Chats: Sometimes the agent might fail at serving some user query and might cause your agent to break , in such case that request is failed. You can look at the traces and logs to understand what happened at each step , each llm call and each parsing that happened. 3. User feedback in the chatbot: Its always better to have some kind of a feedback mechanism inside the UI of your agent to capture if the response by the agent was good or not. This is a valuable marker for use that is organic and true with the user. 4. User patterns: You might observer some patterns that user are following with your agent , maybe you need to see what tasks users are performing frequently and see how we can improve that task or that capability of the agent. 5. Direct user feedback: The most valuable data point that you would ever get is live feedback from the user, be it on online meetings or some meetups. You can have a genuine conversation with user and get important feedback. ## How do they help you By observing the tracing logs you can save the cost of each interaction with the agent by choosing the right LLM to use at each step. You can also see what parsing techniques are performing better with XML or JSON, also seeing the tool calls traces you will be able to understand if you have written the tools in way that is comprehensible to the smart LLM's. Failed chats allows you to find the loop holes in the agent, maybe some queries are causing recursion and eventually crash the agent. Also by referencing and analyzing the chats where users gave good feedback , you can extract good prompts for the LLM's and some user approved response formats with relevant examples in the prompt. ## Better Agents After seeing all of this data , your beliefs might shatter , the feature that you thought was so important maybe isn't, the users want something else, maybe the core reason why people are using the agent is totally different from what you intended it to. Facing the harsh truth and seeing the loopholes and failed chats you will be informed with the holes that need cementing. By prioritizing these issues and fixing them will make your agents flow smoothly through each node and solve real user problems. ## P.S This was a very high level overview and short article on the topic I'am thinking of writing on this topic in more detail. I hope you enjoyed it , if you have any feedback let me know ,Peace, GG! --- # Managing LLM Hallucinations with Faithfulness Check If you are developing an AI agent or a simple rag app. You must have faced the issue where the LLM spits out random made-up stuff that is not true and not relevant to the context that you provided This is called the infamous "Hallucination" Trait of the powerful LLMs where they start acting super weird. ![](https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExbWdocHNvcTk4OHB1Nm1keTZxNXQ0MmQzYXpnZ2ZwYXVscjd4aHY0aSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/0GtVKtagi2GvWuY3vm/giphy.gif) They will hallucinate even when you have set the temperature as 0 in the model config. So how do we solve this issue, how to tame the LLMs so that they don't go crazy? Well, there are many solutions out there but the one that worked best for me and is mostly followed in the industry is called Faithfulness Check. ## RAG So let's take an example of a RAG application. It mainly has 3 components 1. A Vector Storage 2. Retriever 3. LLM The vector storage holds our documents, the Retriever does the semantic search on our query and fetches the relevant documents based on the semantic score,e, and the documents are passed as a context to the LLM to generate the answer. That's the basic idea behind the RAG So when an answer is generated it is generated based on these 3 things being passed to an LLM 1. System Prompt 2. Context 3. Question ## Faithfulness Check ![](https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExdHduNWtiMDNrdTNrb3ZjZncybDNoMXJsM2I2d2M1c25yNnk0NDE0diZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/bUtiJfyjuwwJq/giphy.gif) We will add one more step in this flow called the Faithfulness check. Basically, we are going to use another LLM model to check if the answer generated is relevant to the context that was given to the LLM or not. Based on that we will tell the LLM to give a score which will determine if the answer is hallucinating or not. This helps us check if the answer generated is Grounded in actual truth or not. You can use a prompt like this for the Judge LLM: ``` PROMPT = """ Given the following QUESTION, DOCUMENT and ANSWER you must analyze the provided answer and determine whether it is faithful to the contents of the DOCUMENT. The ANSWER must not offer new information beyond the context provided in the DOCUMENT. The ANSWER also must not contradict information provided in the DOCUMENT. Output your final verdict by strictly following this format: "PASS" if the answer is faithful to the DOCUMENT and "FAIL" if the answer is not faithful to the DOCUMENT. Show your reasoning. -- QUESTION (THIS DOES NOT COUNT AS BACKGROUND INFORMATION): {question} -- DOCUMENT: {context} -- ANSWER: {answer} -- Your output should be in JSON FORMAT with the keys "REASONING" and "SCORE": {{"REASONING": , "SCORE": }} """ ``` ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1743943089445/560d425e-05ed-46c9-a894-2a03684ce72b.png) This score will help you determine the accuracy of the answer. This can be paired with tracing solutions like langsmith to determine what's actually causing this in more depth. Based on this you can tweak your pipelines to get better outputs and reduce hallucinations. ![](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExa3hkbjY2cXY5aWdqZnc2ZDczMDhnbzJxanFqcDZvZzV4ZHduOGw0MCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/RYwMtNoSyP4Yw/giphy.gif) --- # Limitations of HTTP / 1.1 and some questions I had about it I am exploring the backend fundamentals and networking these days, while I was exploring the stateless vs stateful protocols, I got to know something interesting that I want to share. So I knew HTTP is built on top of TCP, I wondered how it all works, because HTTP is stateless and TCP is stateful. So I did some research and here's how it all works. ## HTTP / 1.1 The HTTP / 1.1 is built on top of TCP. In browsers, it has a limitation of 6 max connections. You might wonder if we can only have 6 open connections at max, how do I have multiple web apps and websites open in different tabs? So the catch is it allows a maximum of **6 connections per domain**. That's what will enable you to use multiple websites in different tabs. ## TCP When we make a request to any website it first establishes a TCP connection with the server and then it sends the data via HTTP requests and response. These connections don't are not long-living even though they are stateful. They persist for a short amount of time, based on the config you have on your server. It is called **Keep Alive Timeout**. This Keep Alive Timeout is how long the connection stays alive after the server sends back a response. ## Keep-Alive ![](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExazA5NTUwNnZiczl0ZWZlaWFnOHR2bXB2dG9wZDE3NDM0c3pycDFlcyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/OMCoQ7JFE2LNWfU5BV/giphy.gif) By making use of this feature we can handle the Keep Alive Timeout per connection. This can be very useful if a particular API needs frequent access. So if we increase the Keep Alive time, the request will be handled faster because we don't have to establish a connection again and go through the popular process of 3-way handshake again and again. This reduces our CPU and Memory usage on the server side because creating a new connection costs these resources. It has some downsides, you can not keep connections open for too long it might slow down your server. So we have to be careful while doing this as an idle connection can block new requests Below is an example in the Express server for it ```javascript const express = require('express'); const http = require('http'); const app = express(); app.get('/api/myblogs', (req, res) => { res.json({ message: "Here are your blogs!" }); }); // Create an HTTP server with optimized Keep-Alive settings const server = http.createServer(app); server.keepAliveTimeout = 60000; // 60 seconds server.headersTimeout = 65000; // Must be slightly higher than keepAliveTimeout server.listen(3000, () => { console.log('Server running on port 3000'); }); ``` Note: Reference actual networking documentation and books, I have just shared my learnings and understanding of it. If you feel I missed something or anything is wrong, post it in the comments. ![](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExN3FybGFiYWVjYm10anZ0bWE0ZHphNWo1MGxvYTRlaXAzZmZsMGFncCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/sZUdov1axWm1FzZyLA/giphy.gif) --- # My simple 3-step system to solve bugs ## Why a System? We all hate when someone logs a lot of bugs in your code be it your teammate or QA team. So it was always an issue for me when there were many bugs on the board, any scrum tool you use, or even plain Google Docs or Sheets. So I created a simple 3-step method ( it all happened on instinct I didn't plan to create any system as such) ## The System So basically I use a Google doc, in which all the bugs are logged with their title and little description, It doesn't include any images or long logs for those that use your main tool like Azure DevOps or Jira. After you are done with writing the bugs, Then I just quickly go through them one by one and just for a short burst of time think about each bug and try to figure out what things must be causing this. This doesn't have to be accurate or anything just anything that you think is causing this. Do this activity in a very short period of time. And one by one start those thoughts and speculations that you have below that bug. This might look like useless work but as I go solving these bugs later on I tend to forget things a lot. So it is better to write this like this Then prioritize these bugs according to their severity and discuss with the team the fixes that they want. ### Solve, Fix, and Read the logs man …. At this point, I go about solving the bugs. I refer to the document and use the points that I have written about the bug. A lot of times, I find the issue because of those points that I wrote earlier, but sometimes, I don't. It all depends on the bug and your level of understanding of the codebase. ## Some Stupid Bugs Some stupid bugs are just a headache to solve and Iam stuck, so in that case I just write an observation note below that bug in the document and hold it for later or communicate with the team. So in this case, everything is fine locally, so something must be breaking in the deployment or the configuration of the pipeline. So this observation will be useful to communicate with the team to fix this. (This is just a sample example I took please don't take it seriously about it working locally) ## The Dead Bugs Some bugs take time to solve some are solved in a breeze, so then I also added a field called Fixed in the document where I mention what fix I did in a short sentence. The benefit of writing this is when a similar bug arises in the future we can refer. ## What is the use of a such trivial activity? Well yeah, this is a really simple method just like note taking. But it has very good returns in the long run. It totally depends on your situation and the tools that you use but for personal use and as a good documenting practice its really beneficial for you. You don't even have to share this with your team, keep it to yourself, but they can be really useful when you have to refer them again in the future or give KT to someone. Below are a few benefits 1. Good documentation practice 2. If you see a similar bug in the future you can refer to this 3. If the team needs to transfer bugs from you, this doc can be a wonderful reference for them 4. If your manager or lead needs visibility from you, then you can just share this doc 5. Once docs like this build-up you will have a great archive of data about the codebase 6. Giving KTs will be really swift and smooth 7. You will see a rise in productivity 8. Giving status in standup will be really easy This a simple notetaking method that I use, I hope it helps you too. Thanks for reading. --- # Bhangarwala and Azure: A Hackathon Journey of Learning and Failing Forward It was 2022 and I was in my second year of college. There was some secret hackathon happening in our college that we didn't know of. One of my friends told me that the teachers are only listing a few people from our batch for this Hackathon. It was a big opportunity cause it was Microsoft (Azure) organizing this. In a college where hackathons were rare, this was incredibly exciting. ## Only a select few were invited to the event. So I said let it be. We will rock some other time. The next day in the morning, I was still asleep I got a call from my friend who said to me hastily come to college we are participating in this hackathon. I was like are you joking? Then I got ready packed my laptop and went to the college.I saw a lot of familiar faces there. Then we were assigned a table and we called our team "AlphaRuby". There were many topics to choose from. We decided on e-commerce and sustainability. ## We decided to create a platform to sell scrap online called Bhangarwala. One of our team members suggested this idea, and we went for it and started working on it. First, we had to prepare a plan, and we were going to be reviewed based on that. So we started brainstorming. Regarding our skillset, one guy from our team was an Android developer, the other was a pure business guy, and we had one girl partner as well. I was a broken web developer who thought Django was the only framework in the world, and I knew some HTML. ## The Food II have attended many tech events, meetups, and hackathons now, but none provided refreshments like Microsoft. They really cared about the participants. We had pizzas, samosas, muffins, Coke, chai, coffee, garlic bread, and more. For a college student, this was a big deal. ## The Development After the mentors reviewed our approach we had to develop the project. So we started to code. I was very bad at coding at that time I started by creating a Django project and started working on the HTML templates. Nothing worked we were miserable we had never done real development like this before still we tried to build something presentable. We were not able to build a complete end-to-end product. Our idea was that people could use our platform to sell scrap online. So we just created a simple multipage form via which we took data from the user like address, contact, and dates to pick up the scrap and showed a success message at the end. Iam not even sure that the data was being stored in the DB. ## THE CATCH While asking some questions to our mentor we got to know a few things that we missed. 1. ### The hackathon was for professionals This was organized for developers who are working in the industry and have experience working with cloud tech. They couldn't get enough working professionals to participate so they got students from our college to participate. Poor Azure they are still trying to tap more developers than aws. 2. ### We had to deploy on Azure The mentor told us that we had to deploy the projects on Azure. First of all, I knew Azure was a cloud but I had never used one. I didn't understand what exactly we had to do till the end. We tried deploying but it didn't work and the mentors also didn't help much. So further on they selected a few teams and were asked to showcase their projects on the stage with a big screen. All the demos were good and all of them were justified. The professional folks built really good projects. One particular team from our college built a really great project on cutting-edge technology at that time. They used LLM in their project in 2022 when things like ChatGPT weren't even famous. They were really ahead of their time. Winners were announced people got checks and everyone was happy. All teams were invited on stage for a photo session. ## Key Learnings from this experience 1. You have to be around people who are building stuff early on. 2. Never give up on a project and build whatever MVP you can. 3. Don't be stuck with a particular technology learn lots of things. --- # How to get structured outputs from Openai every time. Are you struggling to get structured outputs from OpenAI? Tired of inconsistent formats and hallucinations? 🤯 Well, worry no more! OpenAI has launched **structured outputs** in its beta version. Here's how you can take advantage of it. ## Using Pydantic Models for Structured Outputs First, you need to define your **Pydantic models**, which serve as a schema for the values you want to extract or generate. ### Step 1: Define Your Schema Let's define a schema to extract **novel details** from OpenAI. Create a file called `schema.py` and add the following: ```python from pydantic import BaseModel, Field from typing import List from datetime import date class NovelDetails(BaseModel): novel_name: str = Field(..., description="The name of the novel") writer_name: str = Field(..., description="The author's name") year_published: date = Field(..., description="The publication year of the novel") class Novel(BaseModel): novels: List[NovelDetails] = Field(..., description="List of novels with their details") ``` ### Step 2: Use OpenAI's Structured Output API Now, let's use OpenAI's **beta structured output API** to extract these fields. ```python import openai from schema import Novel openai.api_key = "xxxxxxxxxxxxxxxxxxxxx" response = openai.beta.chat.completions.create( model="gpt-4-turbo", messages=[ {"role": "system", "content": "You are a book expert with vast knowledge about books. Answer user questions accurately."}, {"role": "user", "content": "Give me a list of 10 thriller novels."} ], response_format={"type": "json_schema", "schema": Novel.model_json_schema()} ) parsed_data = Novel(**response.choices[0].message.parsed) print(parsed_data) ``` ### What's Happening Here? 1. **Define the schema**: The `Novel` class ensures that the API response follows a strict format. 2. **Send a request**: Using `openai.beta.chat.completions.create`, we request OpenAI to return structured data. 3. **Parse the response**: The `Novel` model ensures that the extracted data is well-structured and correctly formatted. ### Output Example ```json { "novels": [ { "novel_name": "Gone Girl", "writer_name": "Gillian Flynn", "year_published": "2012-05-24" }, { "novel_name": "The Girl with the Dragon Tattoo", "writer_name": "Stieg Larsson", "year_published": "2005-08-23" } ] } ``` --- # Life Lately: The Highs and Lows #1 Enjoying the work a lot , really have been learning a lot from my seniors and leads. Learning how to quickly maneuver through features and bugs and get stuff done. Also major setup update, bought a HDMI to VGA converter to use my 12year old acer monitor which is still as good as monitor that you will buy in 2024. Also got a JBL mic for better meetings. These two things have been game changers. Also got a amazon basics soundbar , so that i don't have to use headphones a lot and show some love to my ears, it sounds great too i love it. Also bought a wireless gamepad so that i can relax and play humans fall flat with the team(crazy game). Iam having neck main due to bad posture while sitting and sleeping thinking of buying an ergonomic chair so that these things improve. Also trying to get back to watching animes again, watching Fairy Tail because i don't to want typical shonen now and no serious bullshit. Also excited about the upcoming Attack On Titan movie, I hope it will release in India. I will treat someone with tickets for that movie. I will share my technical learnings in another post this is just a casual laid-back post. --- # Empathy as a skill for developers Initially, while working with the team as a developer, I didn't have good communication skills. I struggled to communicate with the team and keep up. Coding skills weren't an issue (though I was being egotistic; it was definitely a major issue). The bigger problem was communication with the team. I couldn't ask questions properly or communicate updates effectively. It was all a mess. It felt like a team with walls. I had to improve. I had to improve this. So, I did the best thing I could do: I reached out to my mentor and explained the situation (not the exact situation, but I asked questions on how to improve communication). > "You should overcommunicate, with other people, give them lots of information, make them feel understood" These are the words my mentor said to me in a one-on-one meeting. She explained in detail and gave me real-life examples, but this sentence captures the essence of it. Here is what I learned while implementing this advice in real life as a developer: ## Why Overcommunicate and How It Shows Empathy: When you work in tech, you often need to work as a team. You have to constantly communicate updates and any blockers you are facing. If someone asks you about a feature that was pending from your side and blocking their task, or if you just made changes to the code or implemented a new feature, you should share as much information as possible. This is important because the other person might be hesitant to ask more questions, or there could be miscommunication. From the beginning, you should have empathy and share detailed information, not just short bullet points. Doing this really helps. The other person feels understood and is more open to clear communication. When you start implementing these changes, you will improve as a team player. How can you implement this? * **Slack:** Instead of sending one-liner messages, share three detailed messages and humanize them. Show empathy. * **Online Meetings:** If you are having an online meeting, ask if the person understood what you are trying to say. Encourage them to ask as many questions as possible and answer them with broader context. Send any updates after the meeting on Slack. Plan a catch-up session if you need to discuss anything more. * **In Person:** Even in person, just ask more questions, and while answering give broader context ## Some Broader examples **Example 1: Code Review Process** During a code review, instead of just pointing out what is wrong with the code, take the time to explain why a particular change is necessary. For instance, if a colleague's code is not following the team's coding standards, you could say: "I noticed that this part of the code doesn't align with our coding standards. Following these standards helps us maintain consistency and readability across the codebase. Could you please update this section to match our guidelines? Let me know if you need any help with this." **Example 2: Handling Blockers** If you encounter a blocker that is preventing you from completing your task, communicate this clearly to your team. For example: "I've run into an issue with the API integration that is blocking my progress on the new feature. I've tried several solutions, but none have worked so far. I'm currently researching alternative approaches, but I wanted to keep everyone informed. If anyone has experience with this issue, your input would be greatly appreciated." **Example 3: Onboarding New Team Members** When a new team member joins, overcommunicate to help them get up to speed. For example: "Welcome to the team! Here are some resources that might help you get started: our project documentation, coding standards, and a list of key contacts. Feel free to reach out to me if you have any questions or need clarification on anything. I'm here to help you settle in smoothly." **Example 4: Daily Stand-ups** During daily stand-up meetings, provide detailed updates rather than brief statements. For example: "Yesterday, I completed the user authentication module and started working on the user profile feature. I encountered a minor issue with the database schema, but I managed to resolve it. Today, I'll continue with the user profile feature and aim to have it ready for review by the end of the day. No blockers at the moment." ## Note to the reader: I am not the best coder or the best person, but if you need any help, please feel free to reach out to me. I can always be the person who listens to you. --- # Coding isn't the most important skill as a SDE As naive i was as a developer with no professional experience as a engineer. I learned this thing while working with people from the industry **Coding isn't most important part** yes as a beginner you might think coding is what you do as developer. But the the truth is different. You have to first focus on understanding the business logic of the problem being solved. Then making a flow or laying down a approach about how you are going to do it. Then getting it reviewed by a senior or founder or a product manger and team. Then if you have made any mistakes in the flow, you will adapt take suggestions from the team. Then once you have good enough logic you have to decide a stack that is efficient in your use case and cost efficient. Then after all this you will start coding. --- # How to use LLM's Locally without Internet To use any opensource LLM locally there's an open-source tool in the market which is both free and effective. Go to Ollama and download the setup file. [https://ollama.com/](https://ollama.com/) After downloading the Ollama install it and go the Models page. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717606086644/a2397ab2-34d3-45bf-8e46-230b0793c918.png) Click on the model you want Iam using gemma. ollama run gemma ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717606088980/4dd5fcc5-0f30-47da-8338-80a795619fe8.png) Tun this command and the model will download it's about 5GB. After that you are good to go --- # A show all developers should watch. ### The Billion Dollar Code This is a show about the story of _Terravision_. The software that can allow you to go to the any part of the world virtually. This is a real story about the Joachim Sauter and Axel Schmidt. The Axel Schmidt is a hacker and software developer much like _Steve Wozniak of the Apple_ and Joachim Sauter being the visionary and the CEO of the company ART-COM. The story shows how they build a team of punk developers and get a grant from the German government in the age where digitalization was taking its first steps. For your surprise the famous Google Maps is allegedly said to be a result of the infringement of the Terravision patent due to which they faced a legal suite which is also another main premise of the show. The show goes on to tell us how your products and projects that you hold so dear can be crushed by the giant companies and no one will even know. As no one will get a show as big as this one. I hope you enjoy the show. Cheers! --- # The Playlist: a show all developers and engineers should watch. ## Short Review > A total feast for software developers who love core product development. This is a show about the story of Spotify and how it was built. It's a really interesting show where we get to know about Daniel Ek who is the founder of the Spotify. How they build the product, how they solve engineering challenges that they face in uncharted space of streaming. How the pirates bay the piracy platform had a major impact on the music streaming industry that is thriving today. How the founder of BitTorrent helped Spotify in reducing the loading times of the songs. It also shows you the legal struggles that Spotify had to face. The culture at Spotify is so amazing which is shown in the show. --- # How to create a Discord bot A basic tutorial to create a discord bot. **Step1:** Go to discord developer portal. [Discord Developer Portal — My Applications](https://discord.com/developers/applications) **Step2:** Login with your discord credentials. **Step3:** Click on New application. **Step4:** Fill in your details and customize as you go and we will be done. --- # Test your express server using jest and supertest First of all, it's really easy Step1: Install jest and supertest ```bash npm install jest supertest ``` Step2: Add this to your package.json inside scripts ```json "test": "jest " ``` Step3: Create a folder named test and create file server.test.js ```javascript const request = require('supertest'); const app = require('../index.js'); describe('Test name', () => { it('test add book', async () => { const res = await request(app) .post('/addbook') .send({ book: "Norwegian Wood", author: "Haruki Muramaki" }); expect(res.statusCode).toEqual(200); expect(res.body.status).toEqual('ADDED'); }); }) ``` Step4: Run the test and you are done ```bash npm test ``` You are done enjoy testing your api's. Cheers! --- # I created a Blockchain using Go. Hey I have recently started dabbling with Blockchain technologies and Web3.0. I also started learning Go for backend development. And so, I thought it would be good idea to integrate both these things and make a basic blockchain using Go which will improve my both Blockchain and Go skills. > Here is the project -> [Vikrant-Khedkar/Blockchain-using-GO (github.com)](https://github.com/Vikrant-Khedkar/Blockchain-using-GO) I hope you have fun with it. Let's learn and grow. Cheers. #buildinpublic