(payload: unknown)
| 213 | * anderen wegzuwerfen. |
| 214 | */ |
| 215 | export function readProps(payload: unknown): SidecarFacts { |
| 216 | const props = asRecord(payload); |
| 217 | const modelPath = asString(props['model_path']) || asString(props['model_alias']); |
| 218 | const settings = asRecord(props['default_generation_settings']); |
| 219 | const facts: SidecarFacts = { |
| 220 | model: modelDisplayName(modelPath), |
| 221 | modelPath, |
| 222 | quantization: asString(props['model_ftype']), |
| 223 | }; |
| 224 | const contextTokens = asNumber(settings['n_ctx']); |
| 225 | if (contextTokens !== undefined) { |
| 226 | facts.contextTokens = contextTokens; |
| 227 | } |
| 228 | const slots = asNumber(props['total_slots']); |
| 229 | if (slots !== undefined) { |
| 230 | facts.slots = slots; |
| 231 | } |
| 232 | return facts; |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Die Betriebsart aus `/props` lesen. |
no test coverage detected