v2: Initial clean branch with unit tests + CI/CD pipeline
CI / build (push) Waiting to run
CI / unit-tests (push) Blocked by required conditions
CI / lint (push) Blocked by required conditions

- Started from ac75faa (initial E4B-MarkBase integration)
- Kept Sources/ (all engine code) + Package.swift + .gitignore
- Removed all ad-hoc tests, documentation, scripts, Python files
- Added Tests/00_Unit/ (MathTest, TokenizerTest, SamplerTest)
- Added .gitea/workflows/ci.yaml (build + unit tests + lint)
- Added Scripts/check_resources.sh (memory-aware test runner)
- Added Tests/Manifest.json (resource requirements for all tests)
- Focus: 4-bit quantized models only
This commit is contained in:
MarkBase Admin
2026-07-05 13:29:25 +08:00
commit 8a66b9086a
90 changed files with 22252 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import MarkBase
/// Entry point for MarkBase API server
/// Usage: swift run G12BServer [model_dir] [port] [model_id] [--benchmark]
@main
public struct ServerMain {
public static func main() async throws {
let args = CommandLine.arguments
// Check for benchmark mode
if args.contains("--benchmark") {
let modelDir = args.count > 2 ? args[1] : "./model"
let modelName = args.count > 3 ? args[2] : "markbase"
var benchmark = PerformanceBenchmark(modelDir: modelDir, modelName: modelName)
try await benchmark.run()
return
}
let modelDir = args.count > 1 ? args[1] : "./model"
let port = args.count > 2 ? Int(args[2]) ?? 8080 : 8080
let modelId = args.count > 3 ? args[3] : "markbase-12b"
print("\n╔═════════════════════════════════════════════╗")
print("║ MarkBase API Server ║")
print("╚═════════════════════════════════════════════╝\n")
let server = try MarkBaseServer(modelDir: modelDir, modelId: modelId)
try await server.start(port: port)
}
}