Skip to Content
엔터프라이즈 Java 개발을 위한 응용 AI (Korean Edition)
book

엔터프라이즈 Java 개발을 위한 응용 AI (Korean Edition)

by Alex Soto Bueno, Markus Eisele, Natale Vinto
November 2025
Beginner to intermediate
430 pages
6h 48m
Korean
O'Reilly Media, Inc.
Content preview from 엔터프라이즈 Java 개발을 위한 응용 AI (Korean Edition)

제6장. 추론 API

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

에서 이미 AI와 다양한 모델 유형에 대한 지식을 확장했습니다. 또한 가능한 경우 이러한 모델을 로컬에 배포하고 쿼리로 테스트했습니다. 하지만 모델을 사용할 때는 모델을 적절히 노출하고 조직의 모범 사례를 따르며 개발자가 모델을 쉽게 활용할 수 있는 방법을 제공해야 합니다.

추론 API는 이러한 문제를 해결하여 모든 개발자가 모델에 접근할 수 있도록 합니다. 이 장에서는 Java에서 추론 API를 사용하여 AI/ML 모델을 노출하는 방법을 살펴봅니다.

추론 API란 무엇인가?

추론 API는 머신러닝( ) 개발자가 HTTP, gRPC, Kafka 등 어떤 프로토콜로든 데이터를 머신러닝 모델이 배포된 서버로 전송하고, 결과로 예측값이나 분류 결과를 받을 수 있게 합니다. 실제로 OpenAI나 Gemini 같은 클라우드 모델이나 Ollama를 사용해 로컬에 배포한 모델에 접근할 때마다, 여러분은 그들의 추론 API를 통해 그렇게 합니다.

요즘에는 Google, IBM, Meta 같은 대기업이 훈련한 대규모 모델을 주로 LLM 목적으로 사용하는 것이 일반적이지만, 비즈니스의 특정 문제를 해결하기 위해 소규모 맞춤형 훈련 모델을 사용해야 할 수도 있습니다. 일반적으로 이러한 모델은 조직의 데이터 과학자가 개발하며, 이를 추론하기 위한 코드를 개발해야 합니다.

예를 들어, 은행에서 근무 중이며 데이터 과학자들이 신용카드 거래 사기 여부를 탐지하는 맞춤형 모델을 훈련시켰다고 가정해 보겠습니다. 이 모델은 ONNX 형식의 예측 AI 모델로, 6개의 입력 매개변수와 float 유형의 1개 출력 매개변수를 가집니다.

입력 매개변수는 다음과 같습니다:

distance_from_last_transaction

마지막 거래 발생 시점으로부터의 시간적 거리. 예: 0.3111400080477545.

ratio_to_median_price

구매 가격 거래가 중간 구매 가격 대비 차지하는 비율. 예: 1.9459399775518593.

used_chip

칩을 통해 거래가 이루어졌는지 여부를 나타냅니다: 칩을 사용한 경우( true ) 1.0, 칩을 사용하지 않은 경우( false) 0.0.

used_pin_number

거래가 PIN 번호로 이루어졌는지 여부를 나타냅니다: true 인 경우 1.0, false 인 경우 0.0.

online_order

거래가 온라인 주문인지 여부를 나타냅니다: true 인 경우 1.0, false 인 경우 0.0.

그리고 출력 매개변수는 다음과 같습니다:

prediction

거래가 사기일 확률. 예: 0.9625362.

몇 가지 세부 사항을 확인할 수 있습니다:

  • used_chip 필드와 같이 부울 값을 참조할 때도 모든 값은 부동 소수점 형식입니다.

  • 출력은 확률이지만, 비즈니스 관점에서는 사기가 발생했는지 여부를 알고 싶어 합니다.

  • 개발자는 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

AI 시스템 성능 엔지니어링 (Korean Edition)

AI 시스템 성능 엔지니어링 (Korean Edition)

Chris Fregly
생성형 AI를 위한 프롬프트 엔지니어링

생성형 AI를 위한 프롬프트 엔지니어링

제임스 피닉스, 마이크 테일러
AI 에이전트를 위한 메모리 관리

AI 에이전트를 위한 메모리 관리

Benjamin Labaschin, Jim Allen Wallace, Andrew Brookins, Manvinder Singh

Publisher Resources

ISBN: 0642572279882