🌟 New Blog Just Published! 🌟 📌 Boost LLM Apps with 5 Python Decorators for Speed & Savings 🚀 📖 You’re debugging a chatbot that repeats the same user query three times in a row. Each call hits the LLM API, burns $0.03, and adds a full second of latency. By the time the user sees a response, the.... 🔗 Read more: https://lnkd.in/d4jynYyF 🚀✨ #python-decorators #llm-optimization #api-cost-savings
Optimize LLM Apps with 5 Python Decorators for Speed and Cost Savings
More Relevant Posts
-
Using Claude Code with Obsidian and want to go further? This quickstart guide explains the basics of connecting your own web ui and some methods to control and shape the way in which Claude code works with your content. I document the process step by step starting simple with only 15 lines of Python: text in, text out Then progressively, I add one capability at a time: tool use, streaming, live visibility of what Claude Code is doing, mechanical guardrails the model can't bypass, and lastly context injection, which is where the UI silently tells Claude which documents to reason from. That last part is where it gets interesting. In the example provided, you select a methodology document, type a question, and Claude applies the rules from that document without you having to explain the framework. The document does the scaffolding. Repo is here: https://lnkd.in/dzZCt96S The attached PDF walks through each level with the code.
To view or add a comment, sign in
-
🚀 Day 169 of My LeetCode Journey 🚀 1092. Shortest Common Supersequence 🫧 In this problem, we are given two strings, and we need to build the shortest string that contains both of them as subsequences. ▪️ The key idea is related to the Longest Common Subsequence. If both strings share some common characters in order, we should include those characters only once in the final string. ▪️ First, I built a DP table to find the LCS length between the two strings. This helps us understand which characters are common between them. ▪️ After filling the DP table, I traversed it backwards to construct the final string. ▪️ If characters in both strings match, I add that character once to the result and move diagonally in the table. ▪️ If they don’t match, I move in the direction that gave the larger LCS value and add that character to the result. ▪️ If one string finishes before the other, I simply added the remaining characters from the other string. ▪️ In the end, I reversed the collected characters to get the shortest common supersequence, which contains both strings while keeping the length as small as possible. #LeetCode #DynamicProgramming #Strings #Python #CodingJourney #Day169 🔥
To view or add a comment, sign in
-
-
Just ported my X / Twitter Screenshot service on RapidAPI from Python + Selenium to Rust Native. The results are actually awesome: Request Time: 15s to 5s (3x blazingly faster) Memory Usage: 1.5GB to 75MB (95% lighter) Why scale horizontally when you can just use a better language, better algorithm and better architecture? More requests, lower latency, and my server bill will go for vacations. Try it on: https://lnkd.in/g5wa3KDD --- PS: I will share how I code with my own AI Agent orchestration tool, the tool is easy to use and make our life easier than before
To view or add a comment, sign in
-
🚀 Day 168 of My LeetCode Journey 🚀 583. Delete Operation for Two Strings 🫧 In this problem, we are given two strings and need to find the minimum number of deletions required to make both strings the same. ▪️ Since we are only allowed to delete characters, the idea is to keep the characters that are common in both strings and remove the rest. ▪️ So first, I found the LCS between the two strings. The LCS represents the longest sequence of characters that appears in both strings in the same order. ▪️ I used dynamic programming to build a table where dp[i][j] stores the length of the LCS for the first i characters of word1 and the first j characters of word 2. ▪️ If the characters at the current positions match, we extend the subsequence by adding 1 to the previous result. ▪️ If they do not match, we take the maximum result from the previous possibilities. ▪️ After filling the table, we get the length of the LCS. ▪️ Finally, the minimum deletions needed are: (length of word1 − LCS) + (length of word2 − LCS) ▪️ This works because we keep the common characters and delete everything else from both strings. #LeetCode #DynamicProgramming #Strings #Python #CodingJourney #Day168 🔥
To view or add a comment, sign in
-
-
Day 12: Building My First FastAPI Endpoints ⚡ Continuing my FastAPI journey, today I focused on understanding how APIs actually communicate with clients by building my first endpoints. Here’s what I explored today: ✅ Creating basic API routes using @app.get() ✅ Returning JSON responses from endpoints ✅ Understanding how client requests interact with the server ✅ Testing endpoints through FastAPI’s interactive docs (Swagger UI) ✅ Running and testing the API locally with Uvicorn What stands out about FastAPI is how quickly you can go from writing a few lines of code to having a fully functional API with interactive documentation. 💡 Key takeaway: FastAPI’s combination of Python type hints and automatic documentation significantly simplifies API development. Next, I’ll explore path parameters, query parameters, and request validation to make APIs more dynamic. #FastAPI #Python #BackendDevelopment #APIDevelopment #DevJourney #LearningInPublic #SoftwareDevelopment
To view or add a comment, sign in
-
-
Making terminal navigation visual 🖥️ In my last post, I introduced Pulse, my Python-built GUI terminal. Today, I want to highlight a small feature I implemented that I think can be very useful. Ever find yourself second-guessing the exact name of a subfolder or a file? Or tired of typing 'ls' every two seconds just to see the contents of a folder? In Pulse, if you type cd ./ (or cd ./folder1/folder2/), the terminal intelligently shows you the contents of that path as you type. It’s like having a real-time preview of your destination before you hit enter. It turns directory changes from a blind command into a visual exploration. Watch the video below to see how it works. Check it out on GitHub: https://lnkd.in/dw6f_g3u #Python #Terminal #DevTools #PySide6 #Qt #OpenSource #UIUX
To view or add a comment, sign in
-
I built a YouTube video downloader in Python that lets you pick any video, choose where to save it on your computer, and downloads it in the best quality available. What made this interesting was running into a real world problem mid-build. The first library I used (pytube) was outdated YouTube had changed their system and it simply stopped working. So I found the modern alternative (yt-dlp), understood how it worked, and switched. The project combined three things working together : yt-dlp for downloading, tkinter for the folder picker UI, and clean error handling so nothing crashes silently.
To view or add a comment, sign in
-
🚀 Day 172 of My LeetCode Journey 🚀 44. Wildcard Matching 🫧 In this problem, I had to check if a given string matches a pattern that can contain special characters like ‘?’ and ‘*’. ▪️ The ‘?’ can match any single character, and ‘*’ can match any sequence of characters (even empty). ▪️ I used dynamic programming with recursion (memoization) to solve this. I compared the string and pattern from the end and tried to match them step by step. ▪️ If both characters match or if the pattern has a ‘?’, I move both pointers one step back. ▪️ If the pattern has '*,' I have two choices: 🔹 Treat as matching one character and move the string pointer 🔹 Or treat it as empty and move the pattern pointer ▪️ If the characters don’t match, then that path becomes invalid. ▪️ I also handled edge cases carefully. For example, if the string becomes empty, the pattern should still contain only ‘*’ to match. ▪️ To avoid recomputation, I stored results in a DP table. #LeetCode #DynamicProgramming #Strings #Python #CodingJourney #Day172 🔥
To view or add a comment, sign in
-
-
Today seems like a good day to mention we’ve built our own litellm-esque model library, and that its completely open source. It provides one Python SDK to access any provider. It's simple, fully typed, and modular by design. At a glance: - Simple, modular design (easy to read + contribute to) - Fully typed, LLM-agnostic Pydantic I/O - Built-in model metadata + granular cost tracking (cache read/write, reasoning tokens, per-turn totals) - Agent loop with tool execution + hooks - Image + file support across providers - Retry strategies, including token-aware retries It’s built for simplicity and transparency — with a built-in agent loop + tool hooks, image/file support, and granular cost tracking. It is intentionally small and modular - we wanted it to be easy to understand, verify, and extend. 🔗 Link in the comments!
To view or add a comment, sign in
-
-
🚀 FastAPI — The API framework that actually feels… fast. If you’ve ever built APIs, you know the struggle: Too much boilerplate. Too many validations. Too many moving parts. Now imagine this instead: You write a few lines of Python… and your API is ready, documented, and production-friendly. That’s FastAPI ⚡ In this carousel, I’ve broken it down into the simplest possible way: 🔹 What FastAPI is 🔹 Why it’s insanely fast (performance + development speed) 🔹 What makes it stand out from other frameworks 🔹 Where it’s used in real-world applications 🔹 FastAPI vs REST API (clearing the confusion) 🔹 A simple working example you can understand instantly 💡 What I love most? FastAPI doesn’t just help you build APIs… It helps you build them cleanly, correctly, and quickly. No unnecessary complexity. No guesswork. Just pure developer flow ⚡ 🧠 One takeaway: FastAPI = Speed + Simplicity + Power
To view or add a comment, sign in
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development