Skip to content

OllamaResponse

Defined in: adapters/ollama.ts:109

Ollama API response structure.

Includes the generated message plus performance metrics like duration and token counts specific to local model execution.

  • OllamaRequest
  • OllamaMessage
const response: OllamaResponse = {
model: 'llama2',
created_at: '2024-01-15T12:00:00Z',
message: {
role: 'assistant',
content: 'Hello! How can I help?'
},
done: true,
total_duration: 1500000000,
prompt_eval_count: 10,
eval_count: 6
};

created_at: string

Defined in: adapters/ollama.ts:114

ISO 8601 timestamp


done: boolean

Defined in: adapters/ollama.ts:120

Whether generation is complete


optional eval_count: number

Defined in: adapters/ollama.ts:132

Number of tokens in generation


optional load_duration: number

Defined in: adapters/ollama.ts:126

Model loading duration in nanoseconds


message: OllamaMessage

Defined in: adapters/ollama.ts:117

Generated message


model: string

Defined in: adapters/ollama.ts:111

Model that generated the response


optional prompt_eval_count: number

Defined in: adapters/ollama.ts:129

Number of tokens in prompt evaluation


optional total_duration: number

Defined in: adapters/ollama.ts:123

Total inference duration in nanoseconds