이 adapter가 하는 일
Ollama의 NDJSON streaming을 universal StreamChunk로 번역해. Message content랑 tool call, 그리고 timing을 실은 final done frame까지 처리하고. Health check는 /api/version이 HTTP 200을 주는지로, model listing은 /api/tags로 구현해.
번역 map
| Ollama 필드 | StreamChunk 필드 |
|---|---|
message.content | content |
message.tool_calls | tool_calls (그대로 통과, 이미 dict로 풀려 있어) |
done: true | done = True + tokens_per_sec |
| (없음) | thinking (emit하는 reasoning 모델만 사용) |
에러 어디서 처리?
Adapter의 stream() 안에서. Connection refused → OllamaUnavailable (orchestrator가 잡아서 fallback trigger). Read timeout → ModelLoadingTimeout. 깨진 JSON 줄 → OllamaProtocolError. 셋 다 로그에 남길 만한 context를 달고 올라와.