GenAI for Java Developers 1: Getting started

Microsoft Developer · Beginner ·🧠 Large Language Models ·8mo ago

Key Takeaways

This video teaches Java developers how to get started with generative AI using essential tools and techniques

Full Transcript

[Music] Sometimes brewing Java feels like a science experiment. Grinders, filters, timers. I've ruined my fair share of mornings trying to get it right. Hi everyone. I'm I and I'm a cloud advocate here at Microsoft. My job is to help developers learn, experiment, and also have fun with new technologies. And with me, getting started is always the scariest part. However, if we know the right tools, it doesn't have to be. And that's why I'm so excited to have Rory with me here today. Rory's going to be talking about how we can keep it simple. No complicated setups, no intimidating environments. Just like instant coffee, you'll see how easy it is to get going, especially with GitHub code spaces. So, let's go ahead and dive in. So, the first thing you're going to want to start to do is go on to our demo repo, which is generative AI for beginners-java. And it is set up already with a dev container for you to go in and have Java, the necessary tools, and Visual Studio already set up. So, you're going to go in there, you're going to start, and you're going to fork it. And then, once you fork it, let's go into our fork there, you're going to create a code space from that fork. You're going to go to code there to code spaces. And I've already set up a code space there. And we have a very generous free tier that allows you to run the examples end to end at the same time with your free tier of your code space. I need you to go in and create a fine-grained token to be able to call the free tier of GitHub models. So, GitHub models is an online repository of most of the models that Microsoft and our partners want you to test with. You're going to generate a new token. And here, we'll call it uh token test. And then, you're going to set the permissions. So, if we go there, model permissions. And you can generate that token. And then, you're going to take that token that you see there, and you're going to paste it in to your dev container. So, I've started my dev container here. Here's my dev container. And then, I'm going to go export GitHub token, and I'm going to paste in that token there. And then, I'm going to then go in and set it. Now, I've already got a different token set up and everything. So, I'm ready to rock. So, I've got the GitHub token there, and I'm going to open up my code space, and I'm going to go through to the GitHub models example in the setup dev environment folder. And you can just go into that and just hit debug. Now, it's going to debug, and it's going to break on that point of going into the OpenAI client. We're using the OpenAI SDK. And you can see there, it's saying, "I'm going to use the model GPT-4.1 nano. And it's a very low um throttled model. So, you can do all of the examples with GPT-4.1 nano or the other little bit more heavyweight mini model. And we're going to hit that and we want to say, "Well, say hello world." We're going to add a system message just to tell the model, "Hey, listen, what do you want to do? You're a concise assistant." So, let's run that through there. And we're sending the request to GitHub models. It's using the model 4.1 nano. And then, we can see there, it says hello world. Once you're done, you can just close the code space. So, we'll use that a little bit later. And you can close that there. And in future sessions, we're going to go through core generative AI techniques, practical samples with apps, and then also responsible gen AI. So, to summarize the session that we've just done, we used a dev container, we created a GitHub model, we took a fork that is going to run our code space. We created our code space there. We opened up our code space, and then we ran the basic example. Thank you so much, Rory. I appreciate so much the level of detail you went into into your session. But not just that, how fun and entertaining you keep it the entire time. For everybody who joined us for this episode, if you would want to visit resources related to this episode, you can find them at aka.ms/javaandai for beginners. Link is in the description of this video. We'll see you in the next episode.

Original Description

Resources: https://aka.ms/JavaAndAIForBeginners https://aka.ms/genaijava In this episode, Ayan Gupta is joined by Rory who will guide you through the essential first steps of working with generative AI in Java. Just like brewing the perfect cup of coffee doesn't have to be complicated, getting started with GenAI for Java doesn't need to be intimidating when you have the right tools! Building on the introduction, this hands-on episode shows you exactly how to set up your development environment quickly and easily. You'll learn how to use GitHub Codespaces to eliminate complicated setup processes, how to fork and work with the demo repository, and how to access GitHub Models—Microsoft's online repository of AI models that you can test with for free. Rory demonstrates step-by-step how to create a fine-grained token for accessing GitHub Models, set up your dev container with all the necessary Java tools and Visual Studio Code pre-configured, and run your first "Hello World" example using the OpenAI SDK with GPT-4o mini. The best part? You can do all of this using GitHub's free tier for Codespaces, making it accessible to everyone. This tutorial is perfect for Java developers who want to start experimenting with large language models without the hassle of complex local installations. By the end of this session, you'll have a working development environment and understand the foundational tools you'll use throughout the rest of this series. Next up we'll dive deeper into core generative AI techniques, practical samples, and responsible AI practices. Don't forget to subscribe and follow along! 0:00 - Introduction: Making AI Simple Like Instant Coffee 0:23 - Why Getting Started Is the Scariest Part 0:54 - Setting Up the Demo Repository 1:01 - Forking the Generative AI for Beginners Java Repo 1:26 - Creating Your GitHub Codespace 1:51 - Creating a Fine-Grained Token for GitHub Models 2:42 - Configuring Your Dev Container 3:04 - Running Your First GitHub Models Example 3
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Microsoft Developer · Microsoft Developer · 0 of 60

← Previous Next →
1 Prepare for the DP-300 exam & the Azure Database Administrator Associate cert | Data Exposed
Prepare for the DP-300 exam & the Azure Database Administrator Associate cert | Data Exposed
Microsoft Developer
2 What I Wish I Knew ... about landing a job in tech
What I Wish I Knew ... about landing a job in tech
Microsoft Developer
3 Igniting Developer Innovation with Vector Search
Igniting Developer Innovation with Vector Search
Microsoft Developer
4 Combining the power of vector search with Azure OpenAI then revolutionize image search with vectors!
Combining the power of vector search with Azure OpenAI then revolutionize image search with vectors!
Microsoft Developer
5 What I Wish I Knew ... about finding your place in tech
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
6 Fluent UI React Insights: Accessible by default
Fluent UI React Insights: Accessible by default
Microsoft Developer
7 Signing Container Images with Notary Project
Signing Container Images with Notary Project
Microsoft Developer
8 What I Wish I Knew ... about finding your place in tech
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
9 What programming languages does GitHub Copilot support?
What programming languages does GitHub Copilot support?
Microsoft Developer
10 What I Wish I Knew ... about how much your job can change
What I Wish I Knew ... about how much your job can change
Microsoft Developer
11 What I Wish I Knew ... about how much your job can change
What I Wish I Knew ... about how much your job can change
Microsoft Developer
12 How do I become more confident about AI?
How do I become more confident about AI?
Microsoft Developer
13 How do I become more confident about AI?
How do I become more confident about AI?
Microsoft Developer
14 Performance Demos of SQL’s Intelligent Query Processing Feedback capabilities | Data Exposed
Performance Demos of SQL’s Intelligent Query Processing Feedback capabilities | Data Exposed
Microsoft Developer
15 What I Wish I Knew ... about coming to Microsoft
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
16 What I Wish I Knew ... about coming to Microsoft
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
17 Revolutionizing Image Search with Vectors
Revolutionizing Image Search with Vectors
Microsoft Developer
18 Igniting developer innovation with Vector search and Azure OpenAI
Igniting developer innovation with Vector search and Azure OpenAI
Microsoft Developer
19 Getting Started with Azure AI Studio's Prompt Flow - Part 2
Getting Started with Azure AI Studio's Prompt Flow - Part 2
Microsoft Developer
20 What I Wish I Knew ... about finding my career path
What I Wish I Knew ... about finding my career path
Microsoft Developer
21 What I Wish I Knew ... about finding my career path
What I Wish I Knew ... about finding my career path
Microsoft Developer
22 Windows Terminal's journey to Open Source
Windows Terminal's journey to Open Source
Microsoft Developer
23 Can I trust the code that GitHub Copilot generates?
Can I trust the code that GitHub Copilot generates?
Microsoft Developer
24 What I Wish I Knew ... about interviewing
What I Wish I Knew ... about interviewing
Microsoft Developer
25 What I Wish I Knew ... about interviewing
What I Wish I Knew ... about interviewing
Microsoft Developer
26 What is the Microsoft TechSpark Program?
What is the Microsoft TechSpark Program?
Microsoft Developer
27 SQL Server 2022: Accelerate query performance while reducing query compile time - w/ no code changes
SQL Server 2022: Accelerate query performance while reducing query compile time - w/ no code changes
Microsoft Developer
28 What I Wish I Knew ... about discovering computer science
What I Wish I Knew ... about discovering computer science
Microsoft Developer
29 What I Wish I Knew ... about discovering computer science
What I Wish I Knew ... about discovering computer science
Microsoft Developer
30 Call center transcription and analysis using Azure AI
Call center transcription and analysis using Azure AI
Microsoft Developer
31 How to use Text Analytics for health in Azure AI Language
How to use Text Analytics for health in Azure AI Language
Microsoft Developer
32 Azure OpenAI-powered summarization in Azure AI Language
Azure OpenAI-powered summarization in Azure AI Language
Microsoft Developer
33 Accelerate data labeling using Azure OpenAI and Azure AI Language
Accelerate data labeling using Azure OpenAI and Azure AI Language
Microsoft Developer
34 Building a Private ChatGPT with Azure OpenAI
Building a Private ChatGPT with Azure OpenAI
Microsoft Developer
35 What I Wish I Knew ... about how to interview
What I Wish I Knew ... about how to interview
Microsoft Developer
36 What I Wish I Knew ... about how to interview
What I Wish I Knew ... about how to interview
Microsoft Developer
37 Getting Started with Azure AI Studio's Prompt Flow - Part 3
Getting Started with Azure AI Studio's Prompt Flow - Part 3
Microsoft Developer
38 Intelligent Apps with Azure Kubernetes Service (AKS)
Intelligent Apps with Azure Kubernetes Service (AKS)
Microsoft Developer
39 Getting Started with Azure Blob Storage | Data Exposed: MVP Edition
Getting Started with Azure Blob Storage | Data Exposed: MVP Edition
Microsoft Developer
40 Chat + Your Data + Plugins
Chat + Your Data + Plugins
Microsoft Developer
41 What I Wish I Knew ... about different career paths
What I Wish I Knew ... about different career paths
Microsoft Developer
42 What I Wish I Knew ... about different career paths
What I Wish I Knew ... about different career paths
Microsoft Developer
43 Advanced Dev Tunnels Features | OD122
Advanced Dev Tunnels Features | OD122
Microsoft Developer
44 Learn Live - Manage performance and availability in Azure Cosmos DB for PostgreSQL
Learn Live - Manage performance and availability in Azure Cosmos DB for PostgreSQL
Microsoft Developer
45 Plan your SQL Migration to Azure with confidence | Data Exposed
Plan your SQL Migration to Azure with confidence | Data Exposed
Microsoft Developer
46 What I Wish I Knew ... about social skills in a tech career
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
47 What I Wish I Knew ... about social skills in a tech career
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
48 All About Vectors, Search, and Function Calling in Azure OpenAI - Labor Day Special
All About Vectors, Search, and Function Calling in Azure OpenAI - Labor Day Special
Microsoft Developer
49 Introduction to project ORAS
Introduction to project ORAS
Microsoft Developer
50 What I Wish I Knew ... about finding the right major
What I Wish I Knew ... about finding the right major
Microsoft Developer
51 What I Wish I Knew ... about finding the right major
What I Wish I Knew ... about finding the right major
Microsoft Developer
52 What I Wish I Knew ... about how to approach programming
What I Wish I Knew ... about how to approach programming
Microsoft Developer
53 What I Wish I Knew ... about how to approach programming
What I Wish I Knew ... about how to approach programming
Microsoft Developer
54 Learn Live - Scale from a single node to multiple nodes with Azure Cosmos DB for PostgreSQL
Learn Live - Scale from a single node to multiple nodes with Azure Cosmos DB for PostgreSQL
Microsoft Developer
55 What I Wish I Knew ... about diversity in tech #1
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
56 What I Wish I Knew ... about diversity in tech #1
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
57 Get started with SQL Server AGs across Windows, Linux and Container Replicas | Data Exposed
Get started with SQL Server AGs across Windows, Linux and Container Replicas | Data Exposed
Microsoft Developer
58 Writing LLM Apps with Azure AI and PromptFlow
Writing LLM Apps with Azure AI and PromptFlow
Microsoft Developer
59 What I Wish I Knew ... about how cool working in tech could be
What I Wish I Knew ... about how cool working in tech could be
Microsoft Developer
60 Open Source foundation models in Azure Machine Learning & optimization techniques behind the scenes
Open Source foundation models in Azure Machine Learning & optimization techniques behind the scenes
Microsoft Developer

Related Reads

📰
Panduan Teknikal: Compile llama.cpp di Debian 12/13 dan Cross Compile ARM64
Compile and cross-compile llama.cpp on Debian 12/13 for ARM64 architecture
Dev.to · hardyweb
📰
The first AI was a syllogism machine in 1956. We're still building the same thing.
The first AI, Logic Theorist, was a syllogism machine in 1956, and we're still building similar systems today, highlighting the need to rethink our approach to AI development
Reddit r/artificial
📰
I Tested 300+ Models. Then I Killed the Benchmark.
Learn how to critically evaluate AI benchmarks by testing 300+ models and understanding the limitations of current evaluation methods
Dev.to · Vilius
📰
Human-in-the-Loop Approval for LangChain Agents
Learn to add human approval gates to LangChain agents in under 40 lines of code to prevent unintended side effects
Dev.to · sekera-radim

Chapters (8)

Introduction: Making AI Simple Like Instant Coffee
0:23 Why Getting Started Is the Scariest Part
0:54 Setting Up the Demo Repository
1:01 Forking the Generative AI for Beginners Java Repo
1:26 Creating Your GitHub Codespace
1:51 Creating a Fine-Grained Token for GitHub Models
2:42 Configuring Your Dev Container
3:04 Running Your First GitHub Models Example
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →