research

gpt-oss-20b — Naran 적용 리서치

gpt-oss-20b — Naran 적용 리서치

Naran 프로젝트의 핵심 추론 엔진으로 검토한 모델. 2025년 8월 OpenAI가 공개한 오픈웨이트 reasoning 모델.


기본 스펙

| 항목 | 값 | |------|-----| | 총 파라미터 | 21B | | 활성 파라미터 (inference) | 3.6B (MoE) | | 양자화 | MXFP4 (네이티브) | | VRAM | 16GB | | Context window | 128k tokens | | 라이선스 | Apache 2.0 | | 출처 | OpenAI (미국) | | Hugging Face | openai/gpt-oss-20b |


성능

o3-mini와 동등하거나 우수:

  • AIME 2025 (수학 경시)
  • Codeforces (코딩)
  • TauBench (tool use)
  • HealthBench

Reasoning 수준 조절 가능: Reasoning: low | medium | high (system prompt에 지정)


Harmony 포맷 ⚠️

gpt-oss는 Harmony라는 전용 포맷으로만 학습됨. 이 포맷 없이 쓰면 제대로 동작 안 함.

구조

<|start|>system<|message|>
  Knowledge cutoff: 2024-06
  Reasoning: high
  # Valid channels: analysis, commentary, final.
<|end|>
<|start|>developer<|message|>
  # Instructions
  {system_prompt}

  # Tools
  ## functions namespace
  functions {
    type tool_name = (_: { param: string }) => any;
  }
<|end|>
<|start|>user<|message|>{user_input}<|end|>

Role 계층 (우선순위)

system > developer > user > assistant > tool

Tool call 응답 포맷

<|channel|>commentary to=functions.tool_name
<|constrain|>json
<|message|>{"param": "value"}
<|call|>

일반 OpenAI function calling JSON과 완전히 다른 포맷.

자동 처리되는 환경

  • Ollama
  • vLLM (특수 빌드)
  • HuggingFace Transformers (chat template 사용 시)

직접 inference 구현 시: openai-harmony Python 패키지 사용


Tool Call 안정성 비교

| 방식 | 안정성 | VRAM | 복잡도 | |------|--------|------|--------| | MXFP4 + vLLM | ✅ 안정적 | 16GB 딱 맞음 | 높음 (특수 빌드) | | Ollama (XML 모드) | ⚠️ 조건부 | 16GB | 낮음 | | GGUF + llama.cpp | ❌ 불안정 | 16GB | 낮음 |

llama.cpp GGUF 변환 시 tool call이 reasoning에서 의도만 말하고 실제 tool_call 구조체를 반환하지 않는 문제 보고 있음.


Vercel 연동

OpenAI가 출시 파트너로 Vercel 명시. Vercel AI SDK + Next.js API Routes로 연결 구조:

[Vercel UI]
   ↓ fetch/streaming
[Next.js API Route]
   ↓ OpenAI-compatible endpoint
[vLLM or Ollama]
   ↓
[gpt-oss-20b on local GPU]

Vercel AI SDK의 useChat 훅 + streaming tool calls 지원.


GGUF 빌드

  • Unsloth: unsloth/gpt-oss-20b-GGUF (HuggingFace)
  • 직접 다운로드: huggingface-cli download openai/gpt-oss-20b --include "original/*"

Naran 적용 전략

개발 단계: Ollama (XML tool call 모드)로 빠른 실험 Production 단계: vLLM 특수 빌드로 전환 (tool call 안정성)


관련 링크

  • HuggingFace: https://huggingface.co/openai/gpt-oss-20b
  • GitHub: https://github.com/openai/gpt-oss
  • Harmony 포맷 가이드: https://cookbook.openai.com/articles/openai-harmony
  • Unsloth GGUF: https://huggingface.co/unsloth/gpt-oss-20b-GGUF