localhost
FocusAgent: Simple Yet Effective Ways of Trimming the Large Context of Web Agents
Kerboua, Imene, Shayegan, Sahar Omidi, Thakkar, Megh, Lù, Xing Han, Boisvert, Léo, Caccia, Massimo, Espinas, Jérémy, Aussem, Alexandre, Eglin, Véronique, Lacoste, Alexandre
Web agents powered by large language models (LLMs) must process lengthy web page observations to complete user goals; these pages often exceed tens of thousands of tokens. This saturates context limits and increases computational cost processing; moreover, processing full pages exposes agents to security risks such as prompt injection. Existing pruning strategies either discard relevant content or retain irrelevant context, leading to suboptimal action prediction. We introduce FocusAgent, a simple yet effective approach that leverages a lightweight LLM retriever to extract the most relevant lines from accessibility tree (AxTree) observations, guided by task goals. By pruning noisy and irrelevant content, FocusAgent enables efficient reasoning while reducing vulnerability to injection attacks. Experiments on WorkArena and WebArena benchmarks show that FocusAgent matches the performance of strong baselines, while reducing observation size by over 50%. Furthermore, a variant of FocusAgent significantly reduces the success rate of prompt-injection attacks, including banner and pop-up attacks, while maintaining task success performance in attack-free settings. Our results highlight that targeted LLM-based retrieval is a practical and robust strategy for building web agents that are efficient, effective, and secure.
Serving ML Models with TorchServe
This post will walk you through a process of serving your deep learning Torch model with the TorchServe framework. There are quite a bit of articles about this topic. However, typically they are focused either on deploying TorchServe itself or on writing custom handlers and getting the end results. That was a motivation for me to write this post. It covers both parts and gives end-to-end example.
ML Model: Building and Deploying using StreamLit, Docker, GKE
Responsible for replacing and updating pods as and when needed without any downtime. Services: Services are responsible for routing and load-balancing traffic from external and internal sources to pods. Whenever a pod is deployed or replaced, its IP address changes. Hence a stable address provider is needed. A service provides stable IP addressing and DNS name to pods. We will define deployment and service for each of our applications.
GitHub - serpapi/automatic-images-classifier-generator: Generate machine learning models fully automatically to clasiffiy any images using SERP data
Disclaimer: This open-source machine learning software is not one of the product offerings provided by SerpApi. The software is using one of the product offerings, SerpApi's Google Images Scraper API to automatically create datasets. You may register to SerpApi to claim free credits. You may also see the pricing page of SerpApi to get detailed information. Machine Learning Tools for automatic large image datasets creation powered by SerpApi's Google Images Scraper API Delivery of data necessary to create a visualization for cross-comparing different machine learning models with subtle changes in their neural network structure.
Machine Learning Streaming with Kafka, Debezium, and BentoML
Putting a Machine Learning project to life is not a simple task and, just like any other software product, it requires many different kinds of knowledge: infrastructure, business, data science, etc. I must confess that, for a long time, I just neglected the infrastructure part, making my projects rest in peace inside Jupiter notebooks. But as soon as I started learning it, I realized that is a very interesting topic. Machine learning is still a growing field and, in comparison with other IT-related areas like Web development, the community still has a lot to learn. Luckily, in the last years we have seen a lot of new technologies arise to help us build an ML application, like Mlflow, Apache Spark's Mlib, and BentoML, explored in this post. In this post, a machine learning architecture is explored with some of these technologies to build a real-time price recommender system. To bring this concept to life, we needed not only ML-related tools (BentoML & Scikit-learn) but also other software pieces (Postgres, Debezium, Kafka). Of course, this is a simple project that doesn't even have a user interface, but the concepts explored in this post could be easily extended to many cases and real scenarios. I hope this post helped you somehow, I am not an expert in any of the subjects discussed, and I strongly recommend further reading (see some references below).
Serving PyTorch Models Using TorchServe - Supertype
Model serving has always been a crucial process in MLOps as it decides whether an AI product will be accessible to the user. Upon developing a model that can perform a certain task, the next step is to serve the model so that it is accessible through an API, hence enabling applications to incorporate AI into the system. This process also includes model monitoring and management, which gives the ability to ensure that the model can function properly and scale the model on demand. Various tools have been built as a solution to serve models. Don't worry if some of the terms does not make any sense to you yet.
Sharing Flash Demos with Grid Sessions, Gradio and Ngrok
In this story, we will show how we can create an interactive gradio demo for Lightning Flash Image Classification in just 5 lines of code. We will then show how to host the demo on Grid GPU compute, enabling distributed inferencing. All code for this demo can be found in the repo below. Lightning Flash is a PyTorch AI Factory built on top of PyTorch Lightning. Built for all experience levels, Flash helps you quickly develop strong baselines on your own data across multiple tasks.
GitHub - CrispenGari/gender-classification: this is a simple rest api serving a deep learning model that classifies human gender based on their faces. (vgg16 transfare learning)
This is a simple REST api that is served to classify gender on an image given based on faces. The following table shows all the metrics summary we get after training the model for few 6 epochs. This classification report is based on the first batch of the validation dataset i used which consist of 32 images. If you hit the server at http://localhost:3001/api/gender you will be able to get the following expected response that is if the request method is POST and you provide the file expected by the server. The expected response at http://localhost:3001/api/gender with a file image of the right format will yield the following json response to the client.
microsoft/ML-For-Beginners
Azure Cloud Advocates at Microsoft are pleased to offer a 12-week, 24-lesson curriculum all about Machine Learning. In this curriculum, you will learn about what is sometimes called classic machine learning, using primarily Scikit-learn as a library and avoiding deep learning, which is covered in our forthcoming'AI for Beginners' curriculum. Travel with us around the world as we apply these classic techniques to data from many areas of the world. Each lesson includes pre- and post-lesson quizzes, written instructions to complete the lesson, a solution, an assignment and more. Our project-based pedagogy allows you to learn while building, a proven way for new skills to'stick'.
Locust
"Just as athletes can't win without a sophisticated mixture of strategy, form, attitude, tactics, and speed, performance engineering requires a good collection of metrics and tools to deliver the desired business results."-- The current trend of leveraging the powers of ML in business has made data scientists and engineers design innovative solutions/services and one such service have been Model As A Service (MaaS). We have used many of these services without the knowledge of how it was built or served on web, some examples include data visualization, facial recognition, natural language processing, predictive analytics and more. In short, MaaS encapsulates all the complex data, model training & evaluation, deployment, etc, and lets customers consume it for their purpose. As simple as it feels to use these services, there are many challenges in building such a service e.g.: how do we maintain the service?