Monarch Core AI Assistant Development
Budget / Salary₹12,500–37,500
TypeFreelance project
LocationRemote
Posted1 hour ago
I am developing Monarch Protocol — Monarch Core, a local-first, browser-based AI assistant on Kali Linux. The objective is to run a pretrained language model directly in the browser, without a cloud AI API or a separate AI inference backend, and support offline operation after the initial download and preparation of all required files.
Technology stack and environment
- Operating system: Kali Linux.
- Bundler: Vite 5.4.14.
- Language: JavaScript, HTML, and CSS.
- Model library: @huggingface/transformers 3.7.2.
- ONNX Runtime Web: 1.22.0-dev.20250409-89f8206ba4.
- Target model: onnx-community/Qwen2.5-1.5B-Instruct.
- Intended execution backend: WebAssembly (WASM) for CPU-only inference.
- Alternative backend: WebGPU, if supported by the browser and graphics environment.
- Browser: Google Chrome/Chromium on Kali Linux.
- Hardware: ASUS ROG Strix G16 laptop, 15 GiB RAM, with an NVIDIA GeForce RTX 4050 Laptop GPU. CPU-only inference is the current priority.
- Local development URL: http://127.0.0.1:8080.
Application architecture
The frontend uses Transformers.js to load the pretrained Qwen model and ONNX Runtime Web to execute inference in the browser. The model files are stored locally under public/models/onnx-community/Qwen2.5-1.5B-Instruct/. ONNX Runtime assets are stored under public/onnxruntime/. Vite generates the production application in the dist directory, and Python's HTTP server serves the static files locally. The Python server is not intended to perform AI inference.
The application includes a chat interface, conversation history, local memory, customizable system instructions, a new-conversation feature, and backup export. Local storage is used to preserve supported application data.
Errors encountered
1. The browser initially reported that config.json was missing from the local model directory. The model metadata and tokenizer files were subsequently downloaded.
2. The browser returned HTTP 404 for /onnxruntime/ort-wasm-simd-threaded.asyncify.mjs. Runtime files were copied into the local runtime directory, and later server logs showed successful HTTP 200 responses for the runtime JavaScript and WASM files.
3. The WebGPU backend failed with the following message: “Failed to get GPU adapter. You may need to enable flag '--enable-unsafe-webgpu' if you are using Chrome.”
4. An earlier CPU fallback attempt used device: "cpu", which Transformers.js rejected. The configuration was changed to device: "wasm", the supported CPU-oriented backend option for this setup.
5. The application previously failed because updateProgress was not defined. A progress callback was added.
6. The model configuration, tokenizer, ONNX weight files, and runtime assets are now present locally. The production build completes successfully, and server logs show successful requests for the relevant files.
7. Despite these corrections, WASM model initialization still fails. The application's latest displayed error detail is the numeric value 3587406432. The complete underlying ONNX Runtime exception corresponding to this value has not yet been captured.
Model files
The local model directory contains model_q4f16.onnx (approximately 1.2 GiB) and model_q4.onnx (approximately 1.7 GiB). The model configuration identifies the architecture as Qwen2ForCausalLM and the model type as qwen2. Both model variants are present, but their successful initialization has not been verified.
System resources
The system reports approximately 15 GiB total RAM, with 7.3 GiB available at one measurement, and a swap partition of approximately 15.6 GiB. Disk space is sufficient. No matching kernel out-of-memory messages were found in the checked logs. Memory pressure remains a possibility but has not been confirmed as the cause.
Help required
Please help identify the exact cause of the WASM initialization failure and provide a compatible, reproducible configuration for CPU-only browser inference. Specifically, I need assistance with:
- Interpreting the numeric error 3587406432 and obtaining the underlying ONNX Runtime diagnostic.
- Verifying compatibility between Transformers.js 3.7.2, ONNX Runtime Web 1.22.0-dev, the Qwen2.5 ONNX export, and the selected quantization variant.
- Ensuring the runtime JavaScript modules and WASM binaries are from a consistent, compatible package version.
- Confirming the correct local model file layout and pipeline options.
- Identifying any browser, WASM memory, threading, or model-graph requirements that could prevent initialization.
- Providing a minimal working example and exact Kali Linux commands to test inference independently of the existing UI.
- Preserving browser-based inference, local conversation features, and offline operation without adding an AI backend.
The Vite build succeeds and the local assets are served successfully, but a successful generated response has not yet been achieved. I need a verified solution based on the actual runtime error rather than assumptions about memory or GPU support.
Technology stack and environment
- Operating system: Kali Linux.
- Bundler: Vite 5.4.14.
- Language: JavaScript, HTML, and CSS.
- Model library: @huggingface/transformers 3.7.2.
- ONNX Runtime Web: 1.22.0-dev.20250409-89f8206ba4.
- Target model: onnx-community/Qwen2.5-1.5B-Instruct.
- Intended execution backend: WebAssembly (WASM) for CPU-only inference.
- Alternative backend: WebGPU, if supported by the browser and graphics environment.
- Browser: Google Chrome/Chromium on Kali Linux.
- Hardware: ASUS ROG Strix G16 laptop, 15 GiB RAM, with an NVIDIA GeForce RTX 4050 Laptop GPU. CPU-only inference is the current priority.
- Local development URL: http://127.0.0.1:8080.
Application architecture
The frontend uses Transformers.js to load the pretrained Qwen model and ONNX Runtime Web to execute inference in the browser. The model files are stored locally under public/models/onnx-community/Qwen2.5-1.5B-Instruct/. ONNX Runtime assets are stored under public/onnxruntime/. Vite generates the production application in the dist directory, and Python's HTTP server serves the static files locally. The Python server is not intended to perform AI inference.
The application includes a chat interface, conversation history, local memory, customizable system instructions, a new-conversation feature, and backup export. Local storage is used to preserve supported application data.
Errors encountered
1. The browser initially reported that config.json was missing from the local model directory. The model metadata and tokenizer files were subsequently downloaded.
2. The browser returned HTTP 404 for /onnxruntime/ort-wasm-simd-threaded.asyncify.mjs. Runtime files were copied into the local runtime directory, and later server logs showed successful HTTP 200 responses for the runtime JavaScript and WASM files.
3. The WebGPU backend failed with the following message: “Failed to get GPU adapter. You may need to enable flag '--enable-unsafe-webgpu' if you are using Chrome.”
4. An earlier CPU fallback attempt used device: "cpu", which Transformers.js rejected. The configuration was changed to device: "wasm", the supported CPU-oriented backend option for this setup.
5. The application previously failed because updateProgress was not defined. A progress callback was added.
6. The model configuration, tokenizer, ONNX weight files, and runtime assets are now present locally. The production build completes successfully, and server logs show successful requests for the relevant files.
7. Despite these corrections, WASM model initialization still fails. The application's latest displayed error detail is the numeric value 3587406432. The complete underlying ONNX Runtime exception corresponding to this value has not yet been captured.
Model files
The local model directory contains model_q4f16.onnx (approximately 1.2 GiB) and model_q4.onnx (approximately 1.7 GiB). The model configuration identifies the architecture as Qwen2ForCausalLM and the model type as qwen2. Both model variants are present, but their successful initialization has not been verified.
System resources
The system reports approximately 15 GiB total RAM, with 7.3 GiB available at one measurement, and a swap partition of approximately 15.6 GiB. Disk space is sufficient. No matching kernel out-of-memory messages were found in the checked logs. Memory pressure remains a possibility but has not been confirmed as the cause.
Help required
Please help identify the exact cause of the WASM initialization failure and provide a compatible, reproducible configuration for CPU-only browser inference. Specifically, I need assistance with:
- Interpreting the numeric error 3587406432 and obtaining the underlying ONNX Runtime diagnostic.
- Verifying compatibility between Transformers.js 3.7.2, ONNX Runtime Web 1.22.0-dev, the Qwen2.5 ONNX export, and the selected quantization variant.
- Ensuring the runtime JavaScript modules and WASM binaries are from a consistent, compatible package version.
- Confirming the correct local model file layout and pipeline options.
- Identifying any browser, WASM memory, threading, or model-graph requirements that could prevent initialization.
- Providing a minimal working example and exact Kali Linux commands to test inference independently of the existing UI.
- Preserving browser-based inference, local conversation features, and offline operation without adding an AI backend.
The Vite build succeeds and the local assets are served successfully, but a successful generated response has not yet been achieved. I need a verified solution based on the actual runtime error rather than assumptions about memory or GPU support.
Apply on Freelancer →
Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.