| 79 | } |
| 80 | |
| 81 | export interface IModelProvider { |
| 82 | /** Name that appears in traces and metrics. */ |
| 83 | readonly name: string; |
| 84 | /** One round trip. Honors AbortSignal so the per-prompt `timeout:` works. */ |
| 85 | chat(req: ChatRequest, signal?: AbortSignal): Promise<ChatResponse>; |
| 86 | /** Best-effort token count. Used only for budget gauges, never as a security boundary. */ |
| 87 | countTokens(text: string): number; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Conservative tokenizer. 4 chars/token is the rule of thumb for English |
no outgoing calls
no test coverage detected