Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: gpt-oss disallows quantized cache types due to its use of attention sinks (#7541)

Louisd07dfaf476c8
diff --git a/mlx-server/Sources/MLXServer/ModelRunner.swift b/mlx-server/Sources/MLXServer/ModelRunner.swift
index 65f1d95a6..eb0d6c1fb 100644
--- a/mlx-server/Sources/MLXServer/ModelRunner.swift
+++ b/mlx-server/Sources/MLXServer/ModelRunner.swift
@@ -116,9 +116,6 @@ actor ModelRunner {
) -> GenerateParameters {
GenerateParameters(
maxTokens: maxTokens,
- kvBits: 4, // 4 or 8 bits
- kvGroupSize: 64, // Quantization group size
- quantizedKVStart: 0, // Start quantizing after N tokens
temperature: temperature,
topP: topP,
repetitionPenalty: repetitionPenalty,
@@ -267,17 +264,12 @@ actor ModelRunner {
log("[mlx] Prompt: \(String(format: "%.1f", info.promptTokensPerSecond)) tokens/sec")
log("[mlx] Generation: \(String(format: "%.1f", info.tokensPerSecond)) tokens/sec")
- // Use full prompt token count for accurate usage tracking
- // let promptTokenCount = fullTokens.size
let usage = UsageInfo(
- prompt_tokens: nil,
- // prompt_tokens: promptTokenCount,
+ prompt_tokens: info.promptTokenCount,
completion_tokens: info.generationTokenCount,
- total_tokens: nil
- // total_tokens: promptTokenCount + info.generationTokenCount
+ total_tokens: info.promptTokenCount + info.generationTokenCount
)
let timings = TimingsInfo(
- // prompt_n: promptTokenCount,
predicted_n: info.generationTokenCount,
predicted_per_second: info.tokensPerSecond,
prompt_per_second: info.promptTokensPerSecond