Home Blog Page 572

Building a RESTful API from Scratch

0

What is a RESTful API?

A RESTful API (Representational State Transfer) is a design pattern used to create scalable and stateless web services. It uses standard HTTP methods like GET, POST, PUT, and DELETE to interact with resources.

Step-by-Step Guide to Building a RESTful API

1. Choose Your Framework

Each framework has its unique strengths:

  • Flask (Python): Lightweight and ideal for Python developers.
  • Express.js (JavaScript): Flexible and fast for JavaScript enthusiasts.
  • Django (Python): Best for building robust APIs with Python.

2. Set Up Your Environment

Flask (Python)

pip install flask flask-restful

Express.js (JavaScript)

npm install express body-parser

Django (Python)

pip install django djangorestframework

3. Coding Your API

Here’s a basic example in each framework:

Flask Example

from flask import Flask, jsonify, request

app = Flask(__name__)

@app.route('/api/resource', methods=['GET'])
def get_resource():
    return jsonify({"message": "Hello, RESTful API!"})

if __name__ == '__main__':
    app.run(debug=True)

Express.js Example

const express = require('express');
const app = express();

app.get('/api/resource', (req, res) => {
    res.json({ message: "Hello, RESTful API!" });
});

app.listen(3000, () => console.log('Server running on port 3000'));

Django Example

from django.http import JsonResponse

def get_resource(request):
    return JsonResponse({"message": "Hello, RESTful API!"})

4. Testing Your API

Use Postman or curl to test your endpoints. Example curl command for Flask or Express.js:

curl -X GET http://localhost:3000/api/resource

Pro Tips for API Development

  • Follow REST Principles: Ensure your API endpoints are intuitive and resource-driven.
  • Use Authentication: Implement JWT, OAuth, or API keys for security.
  • Document Your API: Tools like Swagger or Postman can help.

Conclusion

With this guide, you’re ready to build your first RESTful API from scratch! Share your progress or ask questions in the comments. Let’s build something amazing together!

Importing a Fine-Tuned Question Answering Model to Amazon SageMaker

0

Amazon Bedrock: A Fully Managed Service for High-Performing Foundation Models

Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies like AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon through a single API, along with a broad set of capabilities to build generative AI applications with security, privacy, and responsible AI.

Common generative AI use cases, including but not limited to chatbots, virtual assistants, conversational search, and agent assistants, use FMs to provide responses. Retrieval Augment Generation (RAG) is a technique to optimize the output of FMs by providing context around the questions for these use cases. Fine-tuning the FM is recommended to further optimize the output to follow the brand and industry voice or vocabulary.

Custom Model Import for Amazon Bedrock

In this post, we provide a step-by-step approach of fine-tuning a Mistral model using SageMaker and import it into Amazon Bedrock using the Custom Import Model feature. We use the OpenOrca dataset to fine-tune the Mistral model and use the SageMaker FMEval library to evaluate the fine-tuned model imported into Amazon Bedrock.

Key Features of Custom Model Import

Some of the key features of Custom Model Import for Amazon Bedrock are:

  • This feature allows you to bring your fine-tuned models and leverage the fully managed serverless capabilities of Amazon Bedrock
  • Currently, we are supporting Llama 2, Llama 3, Flan, Mistral Model architectures using this feature with a precision of FP32, FP16, and BF16 with further quantizations coming soon
  • To leverage this feature, you can run the import process with your model weights being in Amazon Simple Storage Service (Amazon S3)
  • You can even leverage your models created using Amazon SageMaker by referencing the Amazon SageMaker model Amazon Resource Names (ARN) which provides for a seamless integration with SageMaker
  • Amazon Bedrock will automatically scale your model as your traffic pattern increases and when not in use, scale your model down to 0 thus reducing your costs

Solution Overview

At the time of writing, the Custom Model Import feature in Amazon Bedrock supports models following the architectures and patterns in the following figure.

Prerequisites

We use Mistral-7B-v0.3 in this post because it uses an extended vocabulary compared to its prior version produced by Mistral AI. This model is straightforward to fine-tune, and Mistral AI has provided example fine-tuned models. We use Mistral for this use case because this model supports a 32,000-token context capacity and is fluent in English, French, Italian, German, Spanish, and coding languages. With the Mixture of Experts (MoE) feature, it can achieve higher accuracy for customer support use cases.

Fine-tune the Model using QLoRA

To fine-tune the Mistral model, we apply QLoRA and Parameter-Efficient Fine-Tuning (PEFT) optimization techniques. In the provided notebook, you use the Fully Sharded Data Parallel (FSDP) PyTorch API to perform distributed model tuning. You use supervised fine-tuning (SFT) to fine-tune the Mistral model.

Prepare the Dataset

The first step in the fine-tuning process is to prepare and format the dataset. After you transform the dataset into the Mistral model, you use the metrics F1 Score, Exact Match Score, Quasi Exact Match Score, Precision Over Words, and Recall Over Words. The key metrics for the question answering tasks are Exact Match, Quasi-Exact Match, and F1 over words evaluated by comparing the model predicted answers against the ground truth answers.

Fine-tune the Model using SageMaker

To fine-tune the Mistral model, you submit a SageMaker training job to fine-tune the Mistral model from the SageMaker JupyterLab notebook. You use the Fully Sharded Data Parallel (FSDP) PyTorch API to perform distributed model tuning. You use supervised fine-tuning (SFT) to fine-tune the Mistral model.

Import the Model into Amazon Bedrock

To import the fine-tuned model into Amazon Bedrock, you can use the Amazon Bedrock console, the Boto3 library, or APIs. An import job orchestrates the process to import the model and make the model available from the customer account. The import job copies all the model artifacts from the user’s account into an AWS managed S3 bucket.

Evaluate the Imported Model

You can use the SageMaker FMEval library to evaluate the imported model. The FMEval library supports out-of-the-box evaluation algorithms for metrics such as accuracy, QA Accuracy, and others detailed in the FMEval documentation.

Conclusion

In this post, we explained the different aspects of fine-tuning a Mistral model using SageMaker, importing the model into Amazon Bedrock, invoking the model using both an Amazon Bedrock playground and Boto3, and then evaluating the imported model using the FMEval library. You can use this feature to import base FMs or FMs fine-tuned either on premises, on SageMaker, or on Amazon EC2 into Amazon Bedrock and use the models without any heavy lifting in your generative AI applications.

Authors

Jay Pillai is a Principal Solutions Architect at Amazon Web Services. Rupinder Grewal is a Senior AI/ML Specialist Solutions Architect with AWS. Evandro Franco is a Sr. AI/ML Specialist Solutions Architect at Amazon Web Services. Felipe Lopez is a Senior AI/ML Specialist Solutions Architect at AWS. Sandeep Singh is a Senior Generative AI Data Scientist at Amazon Web Services. Ragha Prasad is a Principal Engineer and a founding member of Amazon Bedrock. Paras Mehra is a Senior Product Manager at AWS.

Tested: Veikk Studio 16 outperforms its price tag

0

Veikk Studio 16: A Budget-Friendly Pen Display

What’s in the Box?

The packaging houses the pen display and stand, a case with two pens, a pen stand, a bag of spare nibs, and all the required cables. I’ve noticed a growing trend recently where the spare nibs and removal tools are often shipped in a disposable bag and I’m really not a fan of this. Firstly, it’s more packaging to throw away, but secondly, it’s not a good storage solution. Considering there’s both a stand and case for the pens, it can’t be that hard to make them so they can house the spares. At least they could be put in the case, although they’d rattle around loosely.

Setup and Build Quality

First things first, I am very impressed with how Veikk has managed to build something that feels this premium for under £300. The Studio 16 feels really good in the hand. It’s solid and robust, without being chunky. The only cheap plastic is the stand, but it does a good job, with three preset angles ready to use and it folds flat and thin, so it’s easy to travel with, which makes a lot of sense for anybody heading out with a laptop.

Performance

The Veikk Studio 16 really surprised me in terms of build quality and performance. In use, it did a great job for drawing, painting, and 3D modeling, as well as simple day-to-day computing. I don’t like using a mouse, so I almost always use a tablet of some form, usually a pen display, as I find it less of a strain.

Should I Buy It?

Some might assume that color accuracy is lower on the agenda of artists purchasing something at this price range, but that doesn’t need to be an issue. With well over 100% SRGB here, colors are rich, accurate, and vibrant. Often anti-glare coatings can make things milky and reduce contrast, but not here.

Conclusion

The Veikk Studio 16 is a budget-friendly pen display that punches above its weight. It’s a great option for artists and designers who want a reliable and accurate drawing experience without breaking the bank. With its good build quality, comfortable design, and impressive performance, it’s a great choice for anyone looking for a pen display.

FAQs

Q: Is the Veikk Studio 16 compatible with my device?
A: Yes, the Veikk Studio 16 is compatible with MacOS, Windows, ChromeOS, Linux, and Android devices.

Q: Can I customize the buttons on the pen display?
A: Yes, the Veikk Studio 16 has customizable buttons that can be set to perform different functions.

Q: Is the pen display accurate?
A: Yes, the Veikk Studio 16 has over 16,000 levels of pressure sensitivity and a resolution that is plenty high enough for most users.

Q: Is the anti-glare coating effective?
A: Yes, the Veikk Studio 16 has an anti-glare coating that reduces reflections and glare, making it easier to work in bright environments.

Electric Dreams: Artists and Technology

Electric Dreams: Art and Technology Before the Internet

Harold Cohen’s Legacy in AI Art

Harold Cohen was already an established painter when he started experimenting with computers in the late 1960s. He began building AARON, a rudimentary AI that could draw semi-autonomously. Unlike today’s AI image generators, which make pictures based on analyzing real images, AARON’s drawings were based purely on the mathematical rules Cohen programmed. Over the years, he continued to improve AARON, teaching it to draw with imprecise strokes to mimic a human hand, to detect shapes and shade them in, and even to physically draw with the help of a device called a "turtle" that would scurry across the canvas making marks.

A Parable for Today’s Artists

Cohen’s story looks like a parable for today’s artists. With the rapid development of technology, many are anxious about its impact on their work. However, Cohen’s story shows that an artist can neither dominate nor fear technology, but rather grow alongside it. His collaboration with AARON resulted in beautiful, abstract pieces that could be mistaken for a child’s drawing of a fantastical map.

Tate Modern’s New Exhibition

The Tate Modern’s new exhibition, Electric Dreams: Art and Technology Before the Internet, brings together the work of over 70 artists who were inspired by and created art with technology between the end of World War II and the dawn of the internet in the early 1990s. The exhibition provides an intriguing precedent for the conversations playing out in the art world today.

A Look Back at the Past

The exhibition also shines a spotlight on the influential 1968 exhibition Cybernetic Serendipity at London’s ICA, the first large-scale exhibition dedicated to the computer as both medium and inspiration. Footage from the show displays moving sculptures, video synthesizers, and a rather dated-looking robot that resembles an off-brand Dalek.

Art Inspired by Math

Art inspired by math sounds like it might be cold, austere, and inaccessible. However, the New Tendencies artists saw their work as a way to make complex scientific ideas digestible, arresting, even beautiful. "You don’t need to think about what you’re seeing, it catches you and acts within your synapses first," says curator Val Ravaglia. "You enjoy the form first, then the rest comes later."

The Exhibition’s Highlights

The exhibition features a range of works, including Monika Fleischmann and Wolfgang Strauss’s "Liquid Views" (1992), which divides an artwork into 12 squares, each containing a blurry, distorted photographic image of a single person or two people. Another standout is Samia Halaby’s kinetic painting "Fold 2" (1988), which features geometric shapes and dynamic lines in vivid colors.

Interactivity and Immersion

Much of the work in the exhibition hits the senses first. David Medalla’s "Sand Machines" drags beads across a patch of sand to create an ever-changing Zen garden, while Brion Gysin’s "Dreamachine" is a revolving lamp that creates optical patterns if you stare at it with your eyes closed. The "Square Tops" sculpture by Wen-Ying Tsai undulates with lights that change frequency in response to the sound made by the people in the room.

Conclusion

The exhibition shows that artists have long been early adopters of new technologies, evolving single works as technology developed. The themes presented in this exhibition are more relevant today than ever, as artists grapple with the impact of technology on their work. As Harold Cohen’s story demonstrates, an artist can neither dominate nor fear technology, but rather grow alongside it.

FAQs

Q: What is the name of the AI that Harold Cohen built?
A: AARON

Q: What is the name of the exhibition at the Tate Modern?
A: Electric Dreams: Art and Technology Before the Internet

Q: When does the exhibition open?
A: November 28

Q: How long does the exhibition run?
A: Until June 1

Playing Pokémon Go: Secretly Mapping the World

0

Pokémon Go Players Help Train AI-Powered Geospatial Model

A Large Geospatial Model to Achieve Spatial Intelligence

You probably didn’t know it, but if you played or are still playing Pokémon Go (there are more than half a million active players), you were helping train an AI-powered geospatial model that aims to map the world.

Building a Visual Positioning System

A blog post from Niantic, the software developer behind the popular game, explains how it’s working on "a large geospatial model to achieve spatial intelligence" and trying to build a "visual positioning system" to understand the world around us — and it’s using data from Pokémon Go.

How Pokémon Go Data Trains the AI Model

To clarify, Niantic is saying that just like data on the web trains AI models, the AI model it’s building needs to understand 3D spaces. An immense amount of data and photographs of 3D spaces are available thanks to Pokémon Go players creeping around the world.

Enhancing the AI Model with Pokémon Go Data

Niantic explains it like this: A local AI mapping model might understand that a church stands at a specific place, but it’s likely only seen the front of that location and can’t explain what the rest of the church looks like. With data from Pokémon Go players, who have likely walked around many churches and trekked areas that cars can’t reach (and photographed those areas), the AI, now has a good guess at what a church generally looks like.

New Feature: Pokémon Playground

The company also pointed out that it recently rolled out a new feature for the game called Pokémon Playground that lets you place a creature at a certain real-world spot for others to see. This means that placing the character and viewing it later conveniently involves using your camera, taking images from multiple angles, and sending the resulting image to Niantic.

Current Progress and Future Plans

According to Niantic, it currently has 10 million scanned locations around the world, with one million of those activated and available for use in its VPS service. It added that it receives about 1 million fresh scans each week, each containing hundreds of images.

Future Applications of the AI-Powered Geospatial Model

Niantic says it will use this data for purposes like AR glasses, robotics, content creation, and autonomous systems. So, not only did the company make money selling in-game items to players, but is also going to make money on the maps those players helped make.

Conclusion

Pokémon Go players have unknowingly contributed to the development of an AI-powered geospatial model that aims to map the world. The data collected from the game will be used to enhance the AI model, which will have various applications in the future.

FAQs

Q: What is the purpose of the AI-powered geospatial model?
A: The model aims to map the world and understand 3D spaces.

Q: How does Pokémon Go data train the AI model?
A: The data provides an immense amount of photographs of 3D spaces, which helps the AI model understand what a location generally looks like.

Q: What are the future applications of the AI-powered geospatial model?
A: The data will be used for purposes like AR glasses, robotics, content creation, and autonomous systems.

Q: How many scanned locations does Niantic currently have?
A: Niantic currently has 10 million scanned locations around the world.

Q: How many of those locations are activated and available for use in its VPS service?
A: One million of those locations are activated and available for use in its VPS service.

Nvidia CEO Obsessed with Google’s NotebookLM AI

0

Nvidia’s AI Push: CEO Jensen Huang Enthusiastic About Applications

Chip giant Nvidia, which dominates the training of artificial intelligence, sold $31 billion worth of the systems last quarter, it reported Wednesday evening.

Nvidia CEO Emphasizes Importance of AI Inference

Nvidia CEO Jensen Huang, who co-founded the company, is also the chief evangelist of all things AI these days. As such, he spent Wednesday evening telling Wall Street analysts about the important applications being made possible with the technology.

Google’s NotebookLM: A Favorite Application

Huang emphasized one of his favorite applications, Google’s Notebook LM, saying he “used the living daylights” out of the AI tool.

The NotebookLM program, which is free to use with a Google account, lets users upload documents and create a summary of their contents. It suggests questions to ask about the documents, engages in a chat about the documents, and it will even create an audio conversation about the contents between two speakers in the style of a podcast.

Nvidia CEO’s Personal Experience with NotebookLM

“I put every PDF, every archived paper into it just to listen to it as well as scanning through it,” he said.

Nvidia’s Focus on Inference

Huang talked about NotebookLM in response to one Wall Street stock analyst’s question about the trends in “inference,” the practice of making predictions with an AI model after the model has been trained.

“Our hope and dream is that someday, the world does a ton of inference,” replied Huang. “That’s when AI has really succeeded,” he continued, “is when every single company is doing inference inside their companies, for the marketing department and forecasting department and supply chain group and their legal department and engineering, of course, and coding.”

Physical AI and Future Predictions

Huang cited other examples of AI inference, such as “physical AI,” meaning AI models that “understand the meaning of the structure” of the physical world and how to “reason” about it. Such models can “not only understand but can predict, roll out a short future.” 

Nvidia’s Future Plans

Huang is betting that inference tasks will be the new growth engine for his company’s data center GPU chip sales, after having dominated the market for chips for training AI models for years.

Huang told Wall Street his company’s latest GPU, “Blackwell,” unveiled in March, is “in great shape,” and will generate billions of dollars of revenue in the fiscal fourth quarter ending in January.

“Blackwell production is in full steam,” said Huang. “We will deliver this quarter more Blackwells than we had previously estimated. And so, the supply chain team is doing an incredible job of working with our supply partners to increase Blackwell, and we’re going to continue to work hard to increase Blackwell through next year. It is the case that demand exceeds our supply.”

Conclusion

Nvidia’s focus on AI inference and its applications is expected to drive growth for the company’s data center GPU chip sales. With the success of its latest GPU, Blackwell, and its enthusiasm for Google’s NotebookLM, Nvidia is poised for a strong future in the AI market.

FAQs

Q: What is NotebookLM?

A: NotebookLM is a free AI tool provided by Google that allows users to upload documents and create a summary of their contents, engage in a chat about the documents, and even create an audio conversation about the contents between two speakers in the style of a podcast.

Q: What is inference in AI?

A: Inference in AI refers to the practice of making predictions with an AI model after the model has been trained. It involves using the trained model to generate new outputs or make decisions based on the input data.

Q: What is Nvidia’s focus on AI inference?

A: Nvidia’s focus is on using AI inference to drive growth for its data center GPU chip sales. The company believes that inference tasks will be the new growth engine for its business, after having dominated the market for chips for training AI models for years.

Q: What is physical AI?

A: Physical AI refers to AI models that “understand the meaning of the structure” of the physical world and how to “reason” about it. Such models can “not only understand but can predict, roll out a short future.”

Preventing AI-Generated Plagiarism in Student Writing

Key Points

As AI cements itself firmly into classrooms, one large and lingering question concerns when and how students can use it appropriately. It takes only seconds to plug a writing prompt into a generative AI tool and receive a completed assignment. Instead of forbidding generative AI tools, it’s critical that teachers show students how and when it’s appropriate to use AI in student writing.

The Bottom Line

When students are confident in their writing skills, they will be less tempted to run directly to AI to generate a writing assignment. Then, teachers can demonstrate how and when it’s appropriate for students to use AI to their benefit.

Strategies for Improving Writing Skills

During an ISTELive 24 session, Sarah Mauel, Amy Miller, and Tahlia Remer, instructional technology trainers in Arizona’s Tempe Union High School District, shared strategies to help students improve their writing skills, thereby improving their self-confidence, along with sharing examples of how to appropriately use AI tools in student writing assignments.

Identifying AI-Generated Writing

It’s generally easy to determine if students have used an AI tool to generate a response to a writing assignment or to generate an entire essay. The biggest tell is that the writing will sound nothing like any of the student’s other submitted assignments. Teachers can also look for:

  • Flawless writing: The grammar is nearly error-free, and the longer the response, the more bloated sentences that repeat the same concept
  • Lack of original/authentic thinking: AI can only compose what it finds on the internet
  • Advanced language: Use of uncommon vocabulary terms when trying to write at a higher level, or using obvious casual language to tone it down
  • Format and structure are traditional and robotic: Consider what a 5-paragraph essay typically looks like when using an outline
  • Use of lists or outlines: AI likes to create subtopics, label them, and then provide encyclopedia-type responses

Rethinking Plagiarism and Cheating

The advent of generative AI also raises the issue of plagiarism–and how educators can (and should) rethink plagiarism and cheating. Teachers should include an AI use chart (like this one from Ditch That Textbook) with their course descriptions and have clear-cut discussions with parents and students about when AI use is and is not acceptable.

Addressing the Reasons Students Use AI

Before bemoaning students’ urge to rely completely on AI, it’s important to identify and address the reasons students use AI to write. Those reasons may include:

  • Lack of writing skills
  • Insecurity around writing skills
  • Struggles with time management
  • Confusion about the topic
  • Missing grammar and organizational skills
  • Having no motivation or interest
  • Missing real-world relevance
  • Poor work ethic
  • Lack of access to resources
  • Home/personal life stress

Making the Writing Process Less Intimidating

It’s important to make the writing process less intimidating. Accepting late work and allowing revisions can really determine if students use AI. If you’re not going to accept it late and they’re not going to have any time [to do the work], they’re going to go ahead and use AI.

Offering Alternative Options

Offering students different options through which to demonstrate their understanding and their writing skills is another way to discourage them from automatically using AI. We have to rethink the full-length essay as the end-all, be-all for assessing student writing skills. It’s intimidating. We can assess their understanding of what they read and their ability to write through shorter bursts of writing.

The Role of AI in the Writing Classroom

Although students should develop their own writing skills and abilities, AI is not going away, so it’s worthwhile to identify the things AI can do in the writing classroom. AI can help personalize content for students based on their level of knowledge, learning speed, and desired learning goals; provide one-on-one learning experiences outside the classroom; give students quick responses to questions to save time; and serve as a 24/7 chatbot for learning to provide learning equity.

Creating AI-Resistant Assignments

Creating assignments that require things AI is not good at is one way to circumvent widespread student AI use. For example, AI is good at conducting research, synthesizing information, using different levels of vocabulary, and adopting a particular tone. AI is not good at offering subjective explanations, evaluative critical thinking, sharing personal experiences, and offering personal reflections.

Approaching AI-Generated Writing

If you do suspect a student has submitted an assignment entirely generated from AI, approaching the issue carefully can ensure open conversations:

  • Recognize your biases and don’t assume the student’s intention
  • Come from a place of support rather than words/actions that shame the student
  • Consider how much AI assistance was used to write the assignment
  • If the piece is 100 percent AI, offer zero credit for that assignment and give the student an opportunity to rewrite it

Communicating with Families

It’s important to communicate with families about AI writing, too. Define what AI-generated writing is, provide a range of acceptable use of AI within your classroom, provide a discipline matrix showing actions for AI use violations, and emphasize that AI has some great tools to assist students with writing, but not in generation of entire assignments.

Conclusion

AI is here to stay, and it’s a companion and helper, not a replacement for humans. Revamp and revise your approach to teaching with AI in mind. Try something new, like shorter bursts of writing and/or collaboration, to assess skills. Train your students on how to use AI ethically–when is it appropriate to use AI? Work on helping students gain confidence in their writing.

FAQs

Q: How can I identify AI-generated writing?
A: Look for flawless writing, lack of original/authentic thinking, advanced language, format and structure are traditional and robotic, and use of lists or outlines.

Q: How can I address the reasons students use AI to write?
A: Identify and address the reasons students use AI to write, such as lack of writing skills, insecurity around writing skills, struggles with time management, and more.

Q: How can I make the writing process less intimidating?
A: Accepting late work and allowing revisions can really determine if students use AI. Offering students different options through which to demonstrate their understanding and their writing skills is another way to discourage them from automatically using AI.

Q: How can I use AI in the writing classroom?
A: AI can help personalize content for students, provide one-on-one learning experiences outside the classroom, give students quick responses to questions to save time, and serve as a 24/7 chatbot for learning to provide learning equity.

Q: How can I approach AI-generated writing?
A: Approach the issue carefully, recognizing your biases and coming from a place of support rather than shame. Consider how much AI assistance was used to write the assignment and offer zero credit for that assignment and give the student an opportunity to rewrite it.

Build Your First Human-in-the-Loop AI Agent

0

Building a Human-in-the-Loop AI Agent: Streamlining Content Creation Workflows with NVIDIA NIM Microservices and LangGraph

Streamlining Manual Workloads with AI Agents

AI agents powered by large language models (LLMs) help organizations streamline and reduce manual workloads. These agents use multilevel, iterative reasoning to analyze problems, devise solutions, and execute tasks with various tools. Unlike traditional chatbots, LLM-powered agents automate complex tasks by effectively understanding and processing information. To avoid potential risks in specific applications, maintaining human oversight remains essential when working with autonomous AI agents.

Building a Human-in-the-Loop AI Agent

In this post, you’ll learn how to build a human-in-the-loop AI agent using NVIDIA NIM microservices, an accelerated API optimized for AI inference. The post features a social media use case to showcase how these versatile AI agents can handle complex tasks with ease. With NIM microservices, you can seamlessly integrate advanced LLMs into your workflows, providing the scalability and flexibility required for AI-driven tasks. Whether you’re creating promotional content or automating complex workflows, this tutorial is designed to accelerate your processes.

Social Media Use Case: Content Creation

One of the biggest challenges marketers face today is generating high-quality, creative promotional content across platforms. The goal is to create varied promotional messages and artwork that can be published on social media.

Architecting the Human-Agent Decision-Making Workflow

Building this human-in-the-loop system involves creating a cognitive workflow where AI agents assist in specific tasks, while humans perform the final decision-making. Figure 1 outlines the interaction between the human decision-maker and the agents.

Constructing the Content Creator Agent

Begin by constructing the Content Creator Agent, which generates promotional messages following specific formatting guidelines, using the NVIDIA API catalog preview API endpoints. NVIDIA AI Enterprise customers can also download and run NIM endpoints locally.

Using the Digital Artist Agent

Next, we introduce the Digital Artist Agent, which transforms promotional text into creative visuals using the NVIDIA sdXL-turbo text-to-image model. This agent rewrites input queries and generates high-quality images designed for social media promotion campaigns. The following code provides an example of how the agent integrates:

Integrating the Agents

The agentic logic places humans at the center as decision-makers, assigning the appropriate agents for each task. LangGraph is used to orchestrate the agentic cognitive architecture.

Launching the Human-Agent Workflow

Now, launch the app. It prompts you to assign one of the available agents for the given task.

Conclusion

In this blog post, you’ve learned how to build a human-in-the-loop AI agent using NVIDIA NIM microservices and LangGraph to streamline content creation workflows. By incorporating AI agents into your workflow, you accelerate content production, reduce manual effort, and retain full control over the creative process.

Frequently Asked Questions

Q: What is a human-in-the-loop AI agent?
A: A human-in-the-loop AI agent is a system that combines AI agents with human decision-making, allowing for more accurate and efficient decision-making.

Q: What is LangGraph?
A: LangGraph is an open-source framework for building and deploying AI-powered applications, including language models, with a focus on explainability and interpretability.

Q: What is NVIDIA NIM microservices?
A: NVIDIA NIM microservices is an accelerated API optimized for AI inference, enabling the integration of advanced LLMs into workflows and providing scalability and flexibility for AI-driven tasks.

Q: How can I get started with building a human-in-the-loop AI agent?
A: Start by exploring the NVIDIA NIM microservices and LangGraph documentation, and then follow the tutorial on building a human-in-the-loop AI agent using NVIDIA NIM microservices and LangGraph.

Upgrade Your Laptop’s RAM

0

How to Install RAM on a Laptop

It’s the bane of all computer systems. Desktops, smartphones, even streaming smart devices. They start out great, but as time goes by they all get slower and slower. It doesn’t happen all at once, but like that famous frog in the boiling water, you finally wake up to realise that you are in hot soup!

Confirm Your Needs

Confirm with your laptop manual that your unit will take RAM upgrades. Ask the vendor you plan to buy the RAM from for compatible options. Most quality vendors know what will work and what won’t. Be aware that most Macs, and a number of PCs laptops today have RAM soldered down. While this doesn’t necessarily prevent an upgrade, it does take it out of the DIY category and get costly.

Set Up Your Workspace

The first step is to find a clean space to work, with enough room to lay all the parts out safely. Ideally it should NOT be over a carpet as that can generate static which can cause all kinds of harm to computer hardware. Plastic folding tables found in large box stores are cheap, a good height for working while standing, and make a non-conductive surface to place electronics.

Open Your Laptop

While desktop computers generally open with a single button or screw, laptops tend to have a protective faceplate that has a million tiny screws. They need to be removed in order to gain access to the motherboard. My laptop’s design is fairly standard, so odds are good that your laptop isn’t very different. Its protective faceplate is located at the bottom of the unit.

Install RAM

Use the screwdriver or an old credit card to gently pry the cover plate off. Always do this slowly as it is very easy to bend these plates. Before you start screwing in all of the tiny screws, flip the computer over and turn it on. Open the About or About this computer dialogue (it is in every OS) and look at the amount of memory. It should match, closely if not exactly, to the amount of memory you just installed.

Re-seat RAM

As you can see in the line Memory, my computer thinks it has just under 4GB of memory installed. But I just installed 8GB! What’s wrong? Shut down the computer, flip it over and take the bottom plate off again (aren’t you glad you didn’t re-screw it all?). Take a closer look at how my install wasn’t a good one! You can see the contacts peaking out from the slot. That means it wasn’t fully inserted and is not making contact. So this chip was not being recognised by the laptop.

Re-seat RAM in Back of Laptop

This was easily resolved by unclipping that stick and re-seating it properly. Once done, the laptop recognised all of the memory I had installed. And I now have more RAM in my laptop.

Which RAM Do I Need?

Before you rush out and buy RAM, let’s go over some of the specs to make sure you get what will work. Computers and laptops have clear specifications as to the type and amount of memory they can use. These specs are in the manual or on website of manufacturer.

DDR4 or DDR5

DDR4 or DDR5 refers to the physical design of RAM. DDR5 came out in 2020 and is spec’d to run almost twice the speed of its predecessor. Though real world gains will be less.

RAM Speed

Within each of those generational designs are a range of speeds. But the bottom line is that while speed differences are measurable, in most situations they aren’t easily felt. Other contributing factors like latency and software design also impact speed.

How Much RAM Do I Need?

How much RAM do we really need? As content creators running image, 3D and video software, we need a lot. I was recently speaking with a musician who runs his Digital Audio Workstation (DAW) on a 16GB iMac. He told me he’s fine, as long as he doesn’t open Safari at the same time.

How Much Does RAM Cost?

Fortunately for us, RAM prices have been on a downward trajectory for years. This makes upgrading to 32 GB or higher very painless. For example, a top brand like Kingston has a 32 GB laptop upgrade “value” kit can be had for under $100. Even their premium Fury line can be had for under $130.

Should I Install RAM Myself?

The last question is, should you grab your laptop and head over to a service? Or should you order some sticks online and spend under a half hour installing them yourself? As always, this is a personal call. If you still have trouble using chop sticks and still ask for a knife and fork to eat sushi, perhaps consider having a professional install your RAM. But honestly, anyone with normal dexterity should not have an issue.

Conclusion

Upgrading your laptop’s RAM is a relatively simple process that can breathe new life into your device. With a little patience and attention to detail, you can increase your laptop’s performance and make it feel like new again.

FAQs

Q: How do I know if my laptop can be upgraded with RAM?
A: Check your laptop manual or manufacturer’s website for specifications on RAM upgrades.

Q: What is the difference between DDR4 and DDR5 RAM?
A: DDR5 is the latest generation of RAM, offering faster speeds and higher capacities than DDR4.

Q: How much RAM do I need?
A: It depends on your usage. For general use, 8GB is sufficient. For content creation, 16GB or more is recommended.

Q: Can I install RAM myself?
A: Yes, with basic technical skills and a little patience, you can install RAM yourself.

Q: How much does RAM cost?
A: Prices vary depending on the type and capacity of RAM. However, you can find a 32GB laptop upgrade kit for under $100.

OpenAI GPT-4o Tops AI Model Rankings

0

OpenAI Updates GPT-4o Flagship Model

Advancements in Reasoning, Multimodality, and Conversational Capabilities

OpenAI has released several new models lately, but GPT-4o remains its most advanced flagship model. It packs advanced reasoning, multimodality, and conversational capabilities into one, and with the latest update, it has become even more capable.

What’s New in the Update?

On Wednesday, OpenAI announced via an X post that it updated GPT-4o to improve overall performance, including better file reading and writing capabilities that allow it to generate more natural and engaging text.

Performance Enhancement

GPT-4o got an update! The model’s creative writing ability has leveled up—more natural, engaging, and tailored writing to improve relevance & readability. It’s also better at working with uploaded files, providing deeper insights & more thorough responses.

— OpenAI (@OpenAI) November 20, 2024

Real-World Testing

Over the past week, before OpenAI announced the launch and the update, the company tested its performance on the Chatbot Arena LLM Leaderboard, a crowdsourced platform used to evaluate large language models (LLMs). Users chatting with the two LLMs side by side and comparing their responses without knowing the models’ names put GPT-4o in first place, above Gemini-Exp-1114. OpenAI also improved GPT-4o in several other categories, including creative writing, coding, and hard prompts, all of which it now ranks first in.

To put them to the test yourself, you can visit the Chatbot Arena and vote for free.

Exciting News from Chatbot Arena❤️‍🔥

Over the past week, the latest @OpenAI ChatGPT-4o (20241120) competed anonymously as "anonymous-chatbot", gathering 8,000+ community votes.

The result? OpenAI reclaims the #1 spot, surpassing Gemini-Exp-1114 with an impressive 1361 score!… https://t.co/Q7q3Uonp94 pic.twitter.com/ogmhhCW7zY

— lmarena.ai (formerly lmsys.org) (@lmarena_ai) November 20, 2024

Accessing GPT-4o

The update does not change how users access GPT-4o. Free users automatically have limited access, and ChatGPT Plus users can select GPT-4o from the toggle model selector. ChatGPT Plus subscription guarantees users unlimited, priority access to GPT-4o, which could be useful if you rely on ChatGPT for your everyday workload. The $20 per month subscription includes other perks such as the Advanced Voice Mode, Canvas, and unlimited image generation.

Conclusion

The updated GPT-4o model is a significant leap forward in natural language processing, with improved performance in creative writing, coding, and hard prompts. OpenAI’s commitment to ongoing development and testing ensures that its models remain the best in the industry. Users can access the updated GPT-4o for free or upgrade to a ChatGPT Plus subscription for unlimited access and priority service.

FAQs

Q: What’s new in the updated GPT-4o model?
A: The update improves file reading and writing capabilities, allowing for more natural and engaging text.

Q: How does GPT-4o perform in real-world testing?
A: GPT-4o outperforms Gemini-Exp-1114 and ranks first in categories such as creative writing, coding, and hard prompts.

Q: How can I access the updated GPT-4o model?
A: Free users have limited access, and ChatGPT Plus subscribers can select GPT-4o from the toggle model selector.

Q: What are the benefits of a ChatGPT Plus subscription?
A: Unlimited, priority access to GPT-4o, Advanced Voice Mode, Canvas, and unlimited image generation.