F5 AI Gateway 언어 기반 라우팅 구성 가이드
F5 AI Gateway 는 요청의 언어 에 따라 지정된 LLM 서비스로 요청을 라우팅할 수 있습니다.
Language Identification Processor를 통해 입력 언어를 판별하고, 해당 언어에 최적화된 백엔드 LLM으로 요청을 전달합니다.
또한, 별도의 패턴 분석을 통해 요청 내 포함된 코드 여부를 감지할 수도 있어, 다양한 조건에 따라 정교한 라우팅이 가능합니다.
이러한 구성은 언어별로 특화된 모델을 효율적으로 운영할 수 있는 기반이 되며, 서비스 품질 향상과 리소스 최적화에 도움이 됩니다.
이 가이드는 Ollama를 백엔드 LLM 서비스로 사용하고, Kubernetes 클러스터에 배포된 F5 AI Gateway를 NGINX Ingress Controller를 통해서 연결하는 환경에서 진행됩니다.
Ollama의 설치 및 배포 방법은 Ollama 설치 및 생성형 AI 배포 포스트를 참고하세요.
NGINX Ingress Controller와 F5 AI Gateway를 통합하는 방법은 F5 AI Gateway Kubernetes NGINX Ingress Controller 통합 포스트를 참고하세요.
참고:
F5 AI Gateway v1.0.2의 Language Identification Processor는 한국어를 지원하지 않기 때문에,
한국어 요청에 대해 특정 LLM 모델로 요청을 라우팅할 수 없습니다.
그러나 영어·일본어 등 지원 언어에 대해서 라우팅을 구성하고, 그 외 요청은 기본 모델로 처리되도록 설정할 수 있습니다.
목차
1. F5 AI Gateway Language Identification Processor란?
1-1. F5 AI Gateway Language Identification Processor 지원 언어
2. 환경 및 버전 정보
3. F5 AI Gateway Language Identification Processor 구성 예시
4. Operands를 사용한 조건 분기 설정
5. F5 AI Gateway Language Identification Processor 적용 확인
6. 결론
1. F5 AI Gateway Language Identification Processor란?
Language Identification Processor는 F5 AI Gateway에서 사용자 요청의 텍스트를 분석하여 언어를 자동으로 감지하는 기능을 수행합니다. 감지한 언어는 ISO 639-1 형식의 태그로 응답(processor > AI Gateway Core)에 추가되며, F5 AI Gateway의 selector와 연계하여 해당 태그값을 기반으로 라우팅 구성을 할 수 있습니다.
설정을 통해 언어뿐만이 아닌, 요청 내 코드 포함 여부를 감지할 수도 있습니다. 코드 감지는 사전에 정의된 정규 표현식 패턴과 프로그래밍 언어의 주요 키워드 집합을 활용하여 요청 내 텍스트에 포함된 코드를 판별합니다. 해당 키워드 집합은 모든 프로그래밍 언어를 포함하는 완전한 패턴 집합은 아니며, 100% 정확하게 모든 코드가 탐지되는 것은 아닙니다.
이 Processor는 감지된 언어 정보를 기반으로 정책 내에서 요청을 라우팅하거나 분기 처리하는 데 활용할 수 있으며, 다국어를 지원하는 환경에서 특정 언어에 최적화된 LLM을 연동할 때 유용하게 사용됩니다.
태그는 다음과 같이 구성됩니다.
| 태그 키 | 설명 | 예시 값 |
language | processor가 감지한 언어 | ["en", "code"] |
1-1. F5 AI Gateway Language Identification Processor 지원 언어
Language Identification Processor는 F5 AI Gateway v1.0.2 버전 기준 아래와 같은 언어를 지원합니다.
영어 “en”은 영국과 미국 영어를 모두 포함하며, 중국어 “zh”은 간체 중국어입니다.
| 언어 | 코드 | 언어 | 코드 |
| 아랍어 | ar | 일본어 | ja |
| 불가리아어 | bg | 폴란드어 | pl |
| 중국어 | zh | 포르투갈어 | pt |
| 네덜란드어 | nl | 러시아어 | ru |
| 영어 | en | 스페인어 | es |
| 프랑스어 | fr | 스와힐리어 | sw |
| 독일어 | de | 태국어 | th |
| 그리스어 | el | 터키어 | tr |
| 힌디어 | hi | 우르두어 | ur |
| 이탈리아어 | it | 베트남어 | vi |
* F5 AI Gateway v1.0.2 버전 Language Identification Processor는 한국어를 지원하지 않습니다.
* 프로그래밍 코드 탐지는 별도의 code 태그로 지정됩니다.
2. 환경 및 버전 정보
- Kubernetes: v1.32.2
- NGINX Plus Ingress Controller: 5.0.0
- F5 AI Gateway: v1.0.2
- F5 AI Gateway Helm chart: aigw-0.1.1
- Ollama: 0.6.5
3. F5 AI Gateway Language Identification Processor 구성 예시
Language Identification Processor의 구성 예시는 다음과 같습니다.
기본적인 F5 AI Gateway processor의 매개 변수 및 정보는 F5 AI Gateway 설정 기초 가이드 포스트의 Processors 설정 항목을 참고하세요.
processors:
- name: language-id
type: external
config:
endpoint: https://aigw-processors-f5.ai-gateway.svc.cluster.local
namespace: f5
version: 1
params:
code_detect: false
threshold: 0.5
reject: false
allowed_languages: []
| 매개변수 | 설명 | 타입 | 필수 여부 | 기본값 | 예시 |
|---|---|---|---|---|---|
| code_detect | 텍스트 내 프로그래밍 코드 감지 여부. 코드가 감지되면 ‘code’ 태그를 사용합니다. | bool | X | false | true, false |
| threshold | 언어 감지를 위한 신뢰도 임곗값. 이 값 미만은 ‘unknown’으로 반환되며 신뢰도 값은 0.0으로 반환됩니다. 0.0으로 설정하면 임곗값이 비활성화됩니다. | float0.0 ~ 1.0 |
X | 0.5 | 0.42 |
| allowed_languages | 프로세서가 요청을 처리하도록 허용된 언어 목록. 감지된 모든 언어가 이 목록에 있어야 합니다. 설정하지 않으면 모든 언어가 허용됩니다. | list[str] | X | [] | [“en”, “fr”] |
참고: allowed_languages 매개 변수를 사용하기 위해선 reject 매개변수를 true로 설정해야 합니다.
구성한 Processor는 AI Gateway 설정의 profiles 항목에서 inputStages 옵션을 통해 AI Gateway가 요청을 해당 Processor를 거치도록 구성할 수 있습니다. 이후 Processor에서 구성된 태그에 따라 selector의 조건과 매칭된 service로 요청이 전달됩니다.
profiles:
- name: chat-profile
inputStages:
- name: check-language # 사용자 지정 이름
steps:
- name: language-id # processors 옵션에서 구성한 이름과 동일하게 구성
services:
- name: ollama/hermes
selector:
operand: or
tags: # processor를 통해 지정된 태그 기반 라우팅
- language:it
- language:code
- language:jp
- name: ollama/tinyllama
services:
- name: ollama/hermes
type: hermes3:8b
executor: ollama
config:
endpoint: "http://192.168.200.129:11434/api/chat"
- name: ollama/tinyllama
type: tinyllama:1.1b
executor: ollama
config:
endpoint: "http://192.168.200.129:11434/api/chat"
processors:
- name: language-id
type: external
config:
endpoint: http://aigw-processors-f5.ai-gateway.svc.cluster.local
namespace: f5
version: 1
params:
code_detect: true
threshold: 0.5
reject: false
위 예시 구성의 경우 language:it, language:code, language:jp 3개의 태그 중 하나라도 존재할 경우 ollama/hermes service로, 이외의 요청은 모두 ollama/tinyllama service로 전달됩니다.
selector의 조건을 설정하는 operand 옵션에 대한 상세한 내용은 다음 목차인 Operands를 사용한 조건 분기 설정을 참고하세요.
4. Operands를 사용한 조건 분기 설정
F5 AI Gateway에서는 operand 값을 사용하여 여러 조건(tag 또는 header 값 등)을 조합해 프로필 또는 서비스 선택 조건을 정교하게 설정할 수 있습니다. 지원되는 operand는 다음과 같습니다:
| Operand | 의미 | 조건 만족 기준 |
|---|---|---|
or 또는 any | OR 조건 | 조건 중 하나라도 일치하면 선택됨 |
and 또는 all | AND 조건 | 모든 조건이 일치해야 선택됨 |
not 또는 none | NOT 조건 | 조건이 일치하지 않아야 선택됨 |
기본값: operand가 명시되지 않으면 or가 기본으로 적용됩니다.
예시 구성:
services:
- name: llama-de-ja
selector:
operand: or
tags:
- language:ja
- language:de
위 구성은 language 태그에 ja 혹은 de 값이 있으면 llama-de-ja profile로 요청을 라우팅합니다.
services:
- name: llama-de-ja
selector:
operand: and
tags:
- language:ja
- language:de
위 구성은 language 태그에 ja와 de 두 값이 모두 있으면 llama-de-ja profile로 요청을 라우팅합니다.
selector의 동작 순서
selector는 정의된 순서대로 평가되며, 첫 번째로 조건에 일치하는 selector를 가진 항목 또는 selector가 없는 항목이 선택됩니다.
services:
- name: en-llm # 1순위
selector:
operand: not
tags:
- language:ja
- language:de
- name: multilingual-ll # 2순위
- 위 예제에서
language:ja또는language:de가 없으면,en-llm이 사용됩니다. - 반면,
language:ja또는language:de가 있으면, 다음 순서인multilingual-llm이 사용됩니다.
services:
- name: multilingual-llm # 1순위 (무조건 매칭)
- name: en-llm # 2순위 (매칭되지 않음)
selector:
operand: not
tags:
- language:ja
- language:de
- 위 구성의 경우
multilingual-llm은 selector가 없기 때문에 항상 조건과 상관없이 우선 선택됩니다. en-llm의 selector는 절대 평가되지 않습니다.
따라서 다음과 같은 설정 순서를 따르는 것이 권장됩니다.
- selector가 있는 설정을 먼저 배치
- 구체적인 조건(selector에
and와 같은 다중 조건)을 앞에 배치 - 기본(default) 서비스는 selector 없이 마지막에 배치
Language Identification Processor에서 감지되지 않는 언어(예: 한국어)의 요청은
어떠한 selector 조건에도 매칭되지 않으므로, selector가 없는 기본 서비스 항목으로 라우팅 됩니다.
이를 활용하면, 특정 언어에만 특화된 모델을 지정하고, 나머지 요청에 포함되는 한국어 요청은 기본 모델로 처리할 수 있습니다.
5. F5 AI Gateway Language Identification Processor 적용 확인
사용한 AI Gateway 설정은 다음과 같습니다.
기본적인 F5 AI Gateway 설정 방법은 F5 AI Gateway 설정 기초 가이드 포스트를 참고하세요.
version: 1
server:
address: :4141
tls:
enabled: true
serverCertPath: /tls/server.crt
serverKeyPath: /tls/server.key
mtls:
enabled: true
clientCertPath: /etc/internal-ca/ca.crt
logging:
level: debug
routes:
- path: /v1/chat/completions
policy: chat-policy
schema: v1/chat_completions
timeoutSeconds: 240
- path: /v1/models
policy: chat-policy
schema: v1/models
policies:
- name: chat-policy
profiles:
- name: chat-profile
profiles:
- name: chat-profile
inputStages:
- name: check-language
steps:
- name: language-id
services:
- name: ollama/hermes
selector:
operand: or
tags:
- language:it
- language:code
- language:jp
- name: ollama/tinyllama
services:
- name: ollama/hermes
type: hermes3:8b
executor: ollama
config:
endpoint: "http://192.168.200.129:11434/api/chat"
- name: ollama/tinyllama
type: tinyllama:1.1b
executor: ollama
config:
endpoint: "http://192.168.200.129:11434/api/chat"
processors:
- name: language-id
type: external
config:
endpoint: http://aigw-processors-f5.ai-gateway.svc.cluster.local
namespace: f5
version: 1
params:
code_detect: true
threshold: 0.5
reject: false
Language Identification Processor가 추가한 태그 중 language:it(이탈리아어), language:code(프로그래밍 코드), language:jp(일본어) 3개의 태그가 하나라도 포함된 경우 ollama/hermes service(hermes3:8b)로, 이외의 경우 모두 ollama/tinyllama service(tinyllama:1.1b)로 전달됩니다.
Postman을 사용하여 요청을 전송했으며, F5 AI Gateway의 트랜잭션 데이터를 로그로 확인하여 요청에 어떤 언어 태그가 추가되는지 확인해 보겠습니다.

이탈리아어로 요청을 전송합니다.


F5 AI Gateway가 요청을 수신하면 language-id processor를 거쳐서 ollama/hermes service로 요청이 전달되어, hermes3:8b 모델이 요청을 처리하고 응답하는 것을 확인할 수 있습니다.
트랜잭션 데이터에서는 다음과 같은 내용을 확인할 수 있습니다.

이탈리아어 감지에 대한 신뢰도 값이 0.99 이상으로 나타나며, language:it 태그가 추가됩니다.
전체 데이터는 다음과 같습니다.
{
"request": {
"request_id": "0196ebf7-c34a-7ed9-8a2f-e7afee22675a",
"tx_map": {
"request_id": "0196ebf7-c34a-7ed9-8a2f-e7afee22675a",
"input_chain": [
{
"steps": [
{
"id": "0196ebf7-c34b-7c68-8181-6a199619d72d",
"processor_id": "language-id",
"input_meta": {
"request_id": "0196ebf7-c34a-7ed9-8a2f-e7afee22675a",
"step_id": "0196ebf7-c34b-7c68-8181-6a199619d72d",
"params": {
"code_detect": true,
"reject": false,
"threshold": 0.5
}
},
"result_meta": {
"request_id": "",
"step_id": "",
"processor_id": "f5:language-id",
"processor_version": "v1",
"processor_result": {
"detected_languages": {
"it": 0.9948364496231079
}
},
"tags": {
"language": [
"it"
]
},
"rejected": false,
"error": false
}
}
]
}
],
"response_chain": []
},
"metadata": {
"schema": "v1/chat_completions",
"original_headers": {
"Accept": [
"*/*"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Connection": [
"close"
],
"Content-Length": [
"120"
],
"Content-Type": [
"application/json"
],
"Postman-Token": [
"1df804a9-7fa9-4f7e-a02f-8c78396b90fe"
],
"User-Agent": [
"PostmanRuntime/7.43.4"
],
"X-Forwarded-For": [
"10.0.27.0"
],
"X-Forwarded-Host": [
"aigw.example.com"
],
"X-Forwarded-Port": [
"80"
],
"X-Forwarded-Proto": [
"http"
],
"X-Real-Ip": [
"10.0.27.0"
]
}
},
"tags": {
"language": [
"it"
]
}
},
"inputSequences": [
{
"name": "__input__",
"content": "{\r\n \"messages\": [\r\n {\r\n \"role\": \"user\",\r\n \"content\": \"Ciao, come stai?\"\r\n }\r\n ],\r\n \"stream\": false\r\n}"
},
{
"name": "0196ebf7-c34b-7c68-8181-6a199619d72d",
"content": ""
}
],
"responseSequences": [
{
"name": "__response__",
"content": "{\"model\":\"hermes3:8b\",\"created_at\":\"2025-05-20T04:34:00.61780526Z\",\"message\":{\"role\":\"assistant\",\"content\":\"Ciao! Sono un'AI e non ho sensazioni o emozioni, quindi non posso dire di stare bene o male in modo simile a un essere umano. Posso però dirti che sono qui per aiutarti e rispondere alle tue domande al meglio delle mie capacità!\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":35080465544,\"load_duration\":7984278236,\"prompt_eval_count\":16,\"prompt_eval_duration\":1701484202,\"eval_count\":69,\"eval_duration\":25390922810}"
}
]
}

영어로 요청을 전송하여 응답을 확인합니다.


이전과 동일하게 language-id processor를 거치지만, ollama/hermes service의 조건에 매칭되지 않아, ollama/tinyllama service로 요청이 전달되어 tinyllama:1.1b 모델이 요청을 처리하고 응답합니다.
트랜잭션 데이터에서는 다음과 같은 내용을 확인할 수 있습니다.

영어 감지에 대한 신뢰도 값이 0.8 수준으로 나타나며, language:en 태그가 추가됩니다.
전체 데이터는 다음과 같습니다.
{
"request": {
"request_id": "0196ec01-9ff0-73ad-8b69-ee7b17f31c6a",
"tx_map": {
"request_id": "0196ec01-9ff0-73ad-8b69-ee7b17f31c6a",
"input_chain": [
{
"steps": [
{
"id": "0196ec01-9ff0-78cb-9007-2450f0d5a1ce",
"processor_id": "language-id",
"input_meta": {
"request_id": "0196ec01-9ff0-73ad-8b69-ee7b17f31c6a",
"step_id": "0196ec01-9ff0-78cb-9007-2450f0d5a1ce",
"params": {
"code_detect": true,
"reject": false,
"threshold": 0.5
}
},
"result_meta": {
"request_id": "",
"step_id": "",
"processor_id": "f5:language-id",
"processor_version": "v1",
"processor_result": {
"detected_languages": {
"en": 0.8112573623657227
}
},
"tags": {
"language": [
"en"
]
},
"rejected": false,
"error": false
}
}
]
}
],
"response_chain": []
},
"metadata": {
"schema": "v1/chat_completions",
"original_headers": {
"Accept": [
"*/*"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Connection": [
"close"
],
"Content-Length": [
"123"
],
"Content-Type": [
"application/json"
],
"Postman-Token": [
"6ca55703-b4d4-4d78-9c22-158df75a2e2c"
],
"User-Agent": [
"PostmanRuntime/7.43.4"
],
"X-Forwarded-For": [
"10.0.134.1"
],
"X-Forwarded-Host": [
"aigw.example.com"
],
"X-Forwarded-Port": [
"80"
],
"X-Forwarded-Proto": [
"http"
],
"X-Real-Ip": [
"10.0.134.1"
]
}
},
"tags": {
"language": [
"en"
]
}
},
"inputSequences": [
{
"name": "__input__",
"content": "{\r\n \"messages\": [\r\n {\r\n \"role\": \"user\",\r\n \"content\": \"Hello. How are you?\"\r\n }\r\n ],\r\n \"stream\": false\r\n}"
},
{
"name": "0196ec01-9ff0-78cb-9007-2450f0d5a1ce",
"content": ""
}
],
"responseSequences": [
{
"name": "__response__",
"content": "{\"model\":\"tinyllama:1.1b\",\"created_at\":\"2025-05-20T04:44:22.376787612Z\",\"message\":{\"role\":\"assistant\",\"content\":\"I am good! I hope you're also having a great day. Is there anything specific about your day that you want me to check up on for you today?\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":10306115516,\"load_duration\":1188385024,\"prompt_eval_count\":40,\"prompt_eval_duration\":661011200,\"eval_count\":35,\"eval_duration\":8449949615}"
}
]
}

이탈리아어와 영어를 혼합하여 요청을 전송하고, 응답을 확인하겠습니다.


요청에 이탈리아어가 포함되어 있어 hermes3:8b 모델이 요청을 처리하고 응답합니다.
트랜잭션 데이터에서는 다음과 같이 2개의 언어를 모두 감지하여 2개의 태그를 추가하는 것을 확인할 수 있습니다.

전체 데이터는 다음과 같습니다.
{
"request": {
"request_id": "0196ec0a-4a1d-7361-9bd9-9331c6a418d9",
"tx_map": {
"request_id": "0196ec0a-4a1d-7361-9bd9-9331c6a418d9",
"input_chain": [
{
"steps": [
{
"id": "0196ec0a-4a1d-79a8-86b6-72df72026c4d",
"processor_id": "language-id",
"input_meta": {
"request_id": "0196ec0a-4a1d-7361-9bd9-9331c6a418d9",
"step_id": "0196ec0a-4a1d-79a8-86b6-72df72026c4d",
"params": {
"code_detect": true,
"reject": false,
"threshold": 0.5
}
},
"result_meta": {
"request_id": "",
"step_id": "",
"processor_id": "f5:language-id",
"processor_version": "v1",
"processor_result": {
"detected_languages": {
"en": 0.9931208491325378,
"it": 0.9940647482872009
}
},
"tags": {
"language": [
"en",
"it"
]
},
"rejected": false,
"error": false
}
}
]
}
],
"response_chain": []
},
"metadata": {
"schema": "v1/chat_completions",
"original_headers": {
"Accept": [
"*/*"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Connection": [
"close"
],
"Content-Length": [
"137"
],
"Content-Type": [
"application/json"
],
"Postman-Token": [
"786586b1-b756-4957-8d1e-1e07a78d8014"
],
"User-Agent": [
"PostmanRuntime/7.43.4"
],
"X-Forwarded-For": [
"10.0.123.0"
],
"X-Forwarded-Host": [
"aigw.example.com"
],
"X-Forwarded-Port": [
"80"
],
"X-Forwarded-Proto": [
"http"
],
"X-Real-Ip": [
"10.0.123.0"
]
}
},
"tags": {
"language": [
"en",
"it"
]
}
},
"inputSequences": [
{
"name": "__input__",
"content": "{\r\n \"messages\": [\r\n {\r\n \"role\": \"user\",\r\n \"content\": \"Ciao, come stai? I'm pretty fine.\"\r\n }\r\n ],\r\n \"stream\": false\r\n}"
},
{
"name": "0196ec0a-4a1d-79a8-86b6-72df72026c4d",
"content": ""
}
],
"responseSequences": [
{
"name": "__response__",
"content": "{\"model\":\"hermes3:8b\",\"created_at\":\"2025-05-20T04:54:16.792267316Z\",\"message\":{\"role\":\"assistant\",\"content\":\"Ciao! Sto bene, grazie per avermelo chiesto. Spero che anche tu stia passando una buona giornata. Cosa posso fare per te oggi? Fammi sapere se hai bisogno di qualcosa o se vuoi discutere di qualche argomento in particolare. Sono qui per aiutarti!\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":37083076809,\"load_duration\":8215090746,\"prompt_eval_count\":21,\"prompt_eval_duration\":2414961945,\"eval_count\":78,\"eval_duration\":26449232439}"
}
]
}
마지막으로 코드가 포함된 요청을 전송하여 확인하겠습니다.



ollama/hermes service로 요청이 전달되어, hermes3:8b 모델이 요청을 처리하고 응답하는 것을 확인할 수 있습니다.
트랜잭션 데이터에서는 영어와 함께 코드를 감지하여 2개의 태그를 추가하는 것을 확인할 수 있습니다.

전체 데이터는 다음과 같습니다.
{
"request": {
"request_id": "0196ecb0-02c0-7328-8535-2fa4af82cae0",
"tx_map": {
"request_id": "0196ecb0-02c0-7328-8535-2fa4af82cae0",
"input_chain": [
{
"steps": [
{
"id": "0196ecb0-02c0-7630-9df1-7c269e2fb9b6",
"processor_id": "language-id",
"input_meta": {
"request_id": "0196ecb0-02c0-7328-8535-2fa4af82cae0",
"step_id": "0196ecb0-02c0-7630-9df1-7c269e2fb9b6",
"params": {
"code_detect": true,
"reject": false,
"threshold": 0.5
}
},
"result_meta": {
"request_id": "",
"step_id": "",
"processor_id": "f5:language-id",
"processor_version": "v1",
"processor_result": {
"detected_languages": {
"code": 1,
"en": 0.9916760921478271
}
},
"tags": {
"language": [
"en",
"code"
]
},
"rejected": false,
"error": false
}
}
]
}
],
"response_chain": []
},
"metadata": {
"schema": "v1/chat_completions",
"original_headers": {
"Accept": [
"*/*"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Connection": [
"close"
],
"Content-Length": [
"233"
],
"Content-Type": [
"application/json"
],
"Postman-Token": [
"13052031-3369-4328-946e-513597b86088"
],
"User-Agent": [
"PostmanRuntime/7.43.4"
],
"X-Forwarded-For": [
"10.0.134.1"
],
"X-Forwarded-Host": [
"aigw.example.com"
],
"X-Forwarded-Port": [
"80"
],
"X-Forwarded-Proto": [
"http"
],
"X-Real-Ip": [
"10.0.134.1"
]
}
},
"tags": {
"language": [
"en",
"code"
]
}
},
"inputSequences": [
{
"name": "__input__",
"content": "{\r\n \"messages\": [\r\n {\r\n \"role\": \"user\",\r\n \"content\": \"Inspect this please. \\n\\n def fibonacci(n):\\n a, b = 0, 1\\n for _ in range(n):\\n print(a)\\n a, b = b, a + b\\n\"\r\n }\r\n ],\r\n \"stream\": false\r\n}"
},
{
"name": "0196ecb0-02c0-7630-9df1-7c269e2fb9b6",
"content": ""
}
],
"responseSequences": [
{
"name": "__response__",
"content": "{\"model\":\"hermes3:8b\",\"created_at\":\"2025-05-20T07:56:31.961639024Z\",\"message\":{\"role\":\"assistant\",\"content\":\"The code you provided defines a function called `fibonacci` that takes an integer `n` as input. The purpose of this function is to generate and print the first `n` numbers in the Fibonacci sequence.\\n\\nHere's how the function works:\\n\\n1. It initializes two variables, `a` and `b`, both set to 0. In the context of the Fibonacci sequence, `a` represents the current number, and `b` represents the next number in the sequence.\\n\\n2. The function then enters a loop that iterates `n` times using a `for` loop with an empty variable `_` as the loop variable (since it's not used within the loop).\\n\\n3. Inside the loop:\\n - It prints the current value of `a`, which represents the current number in the Fibonacci sequence.\\n - It updates the values of `a` and `b`. The new value of `a` becomes the old value of `b`, and the new value of `b` becomes the sum of the old values of `a` and `b`. This step generates the next number in the Fibonacci sequence.\\n\\n4. The loop continues until it has iterated `n` times, printing each number in the Fibonacci sequence up to the `n`th number.\\n\\nThe function does not explicitly return any value, but since it's a Python function, it implicitly returns `None`.\\n\\nOverall, this code looks correct and should generate and print the first `n` numbers in the Fibonacci sequence as expected.\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":111617232873,\"load_duration\":76039529,\"prompt_eval_count\":51,\"prompt_eval_duration\":4029845562,\"eval_count\":308,\"eval_duration\":107509497520}"
}
]
}
6. 결론
F5 AI Gateway의 Language Identification Processor를 활용하면, 입력된 텍스트의 언어를 감지하고 그에 적합한 LLM으로 분기 처리할 수 있어, 다국어 요청이 혼합되는 서비스 환경에서 매우 유용합니다. 특히 백엔드 LLM으로 다양한 언어를 지원하는 모델을 혼합 구성하거나, 언어별 전문 모델을 선택적으로 운용하는 경우 큰 이점을 제공합니다.
현재 v1.0.2 기준으로 한국어(ko)는 Language Processor에서 감지되지 않지만, 한국어 요청은 기본 라우팅 경로로 설정하는 방식으로 활용할 수 있습니다.
운영 중인 AI 서비스에 다양한 모델로의 라우팅 기능이 필요하신가요? NGINX STORE를 통해 문의하여 F5 AI Gateway with NGINX Integration 서비스를 통해 AI 서비스를 보호하세요.
댓글을 달려면 로그인해야 합니다.