Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ enum ComputerUseGateInspector {
let decision: GateDecision
let decisionText: String
if gateIsReached {
finalDisposition = allowlist.isAllowed
finalDisposition =
allowlist.isAllowed
? (dangerousConfirm
? AutonomyDisposition.strictest(policyDisposition, .confirm)
: policyDisposition)
Expand Down
17 changes: 1 addition & 16 deletions Packages/OsaurusCore/Managers/Model/ModelManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -755,22 +755,6 @@ extension ModelManager {
useCase: .vision
),

// DiffusionGemma — block-diffusion (not autoregressive) multimodal
// MoE. `model_type=diffusion_gemma` routes to the vmlx-swift
// block-diffusion engine. Shipping as a Top Pick is gated on a real
// Osaurus load + decode smoke test (visible coherent output, token/s,
// physical footprint within the MXFP8 gate); downgrade to a non-Top
// `preview` entry if that proof can't be produced.
curated(
id: "OsaurusAI/diffusiongemma-26B-A4B-it-MXFP8",
description:
"DiffusionGemma 26B-A4B — block-diffusion multimodal MoE (~4B active), MXFP8. Images + tools + reasoning, high-precision. 128K context.",
isTopSuggestion: true,
modelType: "diffusion_gemma",
releasedAt: date("2026-06-13"),
useCase: .vision
),

// Lower-precision Gemma 4 edge fallbacks (NOT defaults). Within the
// E-series, 8-bit retains far better than 4-bit (E4B: 17% vs 33%
// bounce; E2B: median 19 vs 2 messages). The 4-bit builds stay listed
Expand Down Expand Up @@ -1235,6 +1219,7 @@ extension ModelManager {
"osaurusai/gemma-4-26b-a4b-it-jang_2l",
"osaurusai/gemma-4-26b-a4b-it-jang_4m",
"osaurusai/gemma-4-26b-a4b-it-mxfp4",
"osaurusai/diffusiongemma-26b-a4b-it-mxfp8",
]
}

Expand Down
28 changes: 28 additions & 0 deletions Packages/OsaurusCore/Models/Configuration/MLXModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,34 @@ struct MLXModel: Identifiable, Codable {
)
}

/// A jargon-light version of `name` for first-run surfaces (the onboarding
/// model chooser). The HF-derived `name` carries technical tokens —
/// instruction-tuned (`it`), quant/precision (`MXFP8`, `MXFP4`, `qat`,
/// `4bit`, `bf16`, `JANGTQ`, `JANG_4M`), MoE active-params (`A1B`/`A4B`),
/// and speculative-decode (`MTP`) — which make the title read like a
/// filename. Stripping them yields a product-style title ("Gemma 4 12B").
/// The dropped precision is re-surfaced as a separate chip in the chooser so
/// same-size variants stay distinguishable. Falls back to `name` when
/// stripping would leave nothing.
var simplifiedName: String {
func isJargon(_ token: String) -> Bool {
let t = token.lowercased()
if t == "it" || t == "qat" || t == "mtp" { return true }
// Precision / quantization tokens.
if t.range(of: #"^mxfp\d+$"#, options: .regularExpression) != nil { return true }
if t.range(of: #"^\d+-?bit$"#, options: .regularExpression) != nil { return true }
if t == "fp16" || t == "bf16" || t == "fp32" { return true }
if t.range(of: #"^jangtq\d*$"#, options: .regularExpression) != nil { return true }
if t.range(of: #"^jang_?\d+[a-z]?$"#, options: .regularExpression) != nil { return true }
// MoE active-parameter token (e.g. "A1B", "A4B", "A3B").
if t.range(of: #"^a\d+b$"#, options: .regularExpression) != nil { return true }
return false
}
let kept = name.split(separator: " ").map(String.init).filter { !isJargon($0) }
let result = kept.joined(separator: " ").trimmingCharacters(in: .whitespaces)
return result.isEmpty ? name : result
}

/// Formatted download size string (e.g., "3.9 GB").
///
/// Uses the value-type `ByteCountFormatStyle` rather than allocating a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,8 @@ public final class PrivacyFilterEngine {
// code-block mask to a `nil` (entirely masked) and collect
// the survivors. We do this BEFORE interning so we don't pay
// for placeholders we're about to throw away.
var surviving:
[(category: EntityCategory, original: String, range: Range<String.Index>, label: String?)] =
[]
var surviving: [(category: EntityCategory, original: String, range: Range<String.Index>, label: String?)] =
[]
surviving.reserveCapacity(resolved.count)
for match in resolved {
guard let restored = restore(match.range) else { continue }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,13 @@ enum PrivacyFilterPipeline {
print("[PrivacyFilter] BLOCKING send: \(detail).")
throw PrivacyFilterPipelineError.engineUnavailable(detail)
}
print("[PrivacyFilter] Outbound: filter ENABLED (AI + regex) for provider \(providerId.uuidString); running detection.")
print(
"[PrivacyFilter] Outbound: filter ENABLED (AI + regex) for provider \(providerId.uuidString); running detection."
)
} else {
print("[PrivacyFilter] Outbound: filter ENABLED (regex-only, AI detection off) for provider \(providerId.uuidString); running detection.")
print(
"[PrivacyFilter] Outbound: filter ENABLED (regex-only, AI detection off) for provider \(providerId.uuidString); running detection."
)
}

// Build the effective regex rule set ONCE per pipeline call.
Expand Down
3 changes: 2 additions & 1 deletion Packages/OsaurusCore/PrivacyFilter/Core/PrivacyRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ public struct RuleBuilder: Codable, Hashable, Sendable {
case .exactWord, .anyOfTerms, .startsWith, .endsWith, .contains:
let cleaned = cleanedTerms
guard !cleaned.isEmpty else { return nil }
let alt = cleaned
let alt =
cleaned
.map { NSRegularExpression.escapedPattern(for: $0) }
.joined(separator: "|")
let group = "(?:\(alt))"
Expand Down
Loading
Loading