전체 글
-
[Python Backend] Rest(HTTP)와 gRPC의 개념WEB 2025. 5. 25. 09:04
[Python Backend] Rest(HTTP)와 gRPC의 개념 AI 시스템이 아무래도 FastAPI, Flask와 같은 Backend 프레임워크들과의 조합이 필요하다보니 필연적으로 공부할 수 밖에 없어짐그래서 먼저 Http와 gRPC의 개념을 먼저 살펴보도록 하겠다. 이후론 이 개념을 바탕으로 python backend framework인 Flask과 FastAPI를 공부할 것임. (https://asidefine.tistory.com/330) * 이후 포스트에서 이어집니다 (https://asidefine.tistory.com/330) 그래서 RestAPI와 RPC가 뭔 차인데? gRPC는 HTTP2를 사용한다. (REST는 HTTP1.1)gRPC는 protocol buffer data fo..
-
[AI Agent] LangChain/LangGraph invoke()와 stream() (+ 그리고 How to stream tool calls)AI/NLP 2025. 5. 24. 12:43
[AI Agent] LangChain/LangGraph invoke()와 stream() (+ 그리고 How to stream tool calls) 드디어 소기의 목적인 비동기 기반의 LLM 스트리밍 서비스를 위해 LangChain과 FastAPI를 조합하고, 기존의 invoke() 방식에서 벗어나 astream()을 적용! * 이전 포스트에서 이어집니다 (https://asidefine.tistory.com/332) LangChain의 invoke, stream, batch invoke, stream, batch 함수사용자 정의 체인을 쉽게 만들도록 대부분의 컴포넌트에 Runnable 프로토콜을 구현해 놓았으며, 이 중 invoke, stream, batch는 다음과 같은 역할을 수행하는 표준 인터페이..
-
[AI Agent] Agent와 LangChain AgentExecutor (+ ToolFormer, ReAct, CodeAct Agent)AI/NLP 2025. 5. 24. 11:56
[AI Agent] Agent와 LangChain AgentExecutor (+ ToolFormer, ReAct, CodeAct Agent) Agent란?에이전트는 사전에 정의된 규칙이나 명시적인 프로그래밍 없이도 스스로 결정을 내리고 행동구성AI ModelCapabilities and ToolsLangChain에서 에이전트는 다음과 같은 구성요소로 이루어져 있습니다:Agent: 의사 결정을 담당하는 핵심 컴포넌트입니다.Tools: 에이전트가 사용할 수 있는 기능들의 집합입니다.Toolkits: 관련된 도구들의 그룹입니다.AgentExecutor: 에이전트의 실행을 관리하는 컴포넌트입니다.(1) Tool & Tool BindingTool이 가져야 하는 것함수가 수행하는 작업에 대한 텍스트 설명Argume..
-
[AI Agent] LangChain Expression Language(LCEL)AI/NLP 2025. 5. 24. 11:55
[AI Agent] LangChain Expression Language(LCEL)1) 기본 개념(1) LangChain Expression Language(LCEL)가장 기본적이고 일반적인 사용 사례는 prompt 템플릿과 모델을 함께 연결하는 것chain = prompt | model | output_parserIn [ ]:from dotenv import load_dotenvload_dotenv("/home1/irteamsu/data_ssd2/users/sjson/projects_NHN/llm.mcp/agents-from-scratch/.env")In [ ]:from langchain_core.prompts import PromptTemplatefrom langchain_openai import C..
-
[멀티노드 분산학습] FSDP + Accelerate로 Multi Node Training하기AI/NLP 2025. 5. 24. 11:21
[멀티노드 분산학습] FSDP + Accelerate로 Multi Node Training하기 H100 멀티노드 학습해야 되는데, 방법을 정리한다 FSDP + Accelerate로 Multi Node Training참고Fine-tuning Llama 2 70B using PyTorch FSDP[Linux] Slurm 스케줄러 활용법SLURM 예시 파일Takeaway Message.FSDP+Accelerate 기반으로 분산학습 수행할 땐 SLURM (Simple Linux Utility for Resource Management)라는 것을 사용한다고 함SLURM이란 ?cluster server 상에서 작업을 관리하기 위한 프로그램 -> 여러 대의 서버에서 학습을 자동으로 분산 실행하고 자원을 ..
-
[Team Seminar] Why do LLMs attend to the first token?AI/NLP 2025. 5. 10. 16:22
[Team Seminar] Why do LLMs attend to the first token? 원래 궁금하던 논문이었는데 때마침 팀원분이 리뷰해주셔서 나이스 https://arxiv.org/abs/2504.02732 Why do LLMs attend to the first token?Large Language Models (LLMs) tend to attend heavily to the first token in the sequence -- creating a so-called attention sink. Many works have studied this phenomenon in detail, proposing various ways to either leverage or alleviate..
-
[AI Agent] AI Agent with LangChain / LangGraph / LangSmithAI/NLP 2025. 5. 10. 16:12
[AI Agent ] AI Agent with LangChain / LangGraph / LangSmith 1. LangChain 이해하기¶https://wikidocs.net/book/14314 In [1]:from IPython.core.display import display, HTMLdisplay(HTML("")) /tmp/ipykernel_42131/3510566465.py:1: DeprecationWarning: Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython.display from IPython.core.display import display,..
-
LLM 서빙하기 (2) - Triton Inference Server로 LLM 서빙하기 (HuggingFace 모델을 Triton으로 배포하는 방법)AI/NLP 2025. 4. 5. 20:03
LLM 서빙하기 (2) - Triton Inference Server로 LLM 서빙하기 (HuggingFace 모델을 Triton으로 배포하는 방법) 아래에선 HuggingFace 모델을 Triton으로 배포하는 방법을 배워보자 https://github.com/triton-inference-server/tutorials/tree/main/HuggingFace Triton에 HuggingFace 모델 배포하는 2가지 방법:✅ 방법 1: Python Backend 사용 (전체 파이프라인 통째로 배포)빠르고 간단하게 배포하고 싶을 때 사용Python 코드 안에 전처리 → 모델 추론 → 후처리 모두 포함model.py에서 TritonPythonModel 클래스를 만들고,initialize(..