Windows Setup
This guide covers Windows-specific configuration and troubleshooting for Crucible.
Configuration File Locations
Section titled “Configuration File Locations”Crucible uses a cross-platform configuration system that works consistently across Linux, macOS, and Windows.
Main Configuration File
Section titled “Main Configuration File”The primary configuration file location follows platform conventions:
- Linux:
~/.config/crucible/config.toml(XDG Base Directory) - macOS:
~/Library/Application Support/crucible/config.toml - Windows:
%APPDATA%\crucible\config.toml(e.g.,C:\Users\YourName\AppData\Roaming\crucible\config.toml)
Note: On Windows, Crucible uses
%APPDATA%(Roaming AppData) which is the standard Windows location for user configuration files that should roam with the user profile.
Kiln-Specific Configuration
Section titled “Kiln-Specific Configuration”Each kiln (knowledge base) can have its own configuration:
- Kiln config:
KILN_ROOT/.crucible/directory- Database:
KILN_ROOT/.crucible/kiln.db - Plugins:
KILN_ROOT/.crucible/plugins/ - Agents:
KILN_ROOT/.crucible/agents/
- Database:
Discovery Paths
Section titled “Discovery Paths”Crucible searches for plugins and agents in the following order:
-
Kiln-specific (highest priority):
KILN_ROOT/.crucible/plugins/KILN_ROOT/.crucible/agents/
-
Global user directories:
- Windows:
%APPDATA%\crucible\plugins\,%APPDATA%\crucible\agents\
- Windows:
-
Additional paths from
config.toml
Creating Your Configuration File
Section titled “Creating Your Configuration File”To create your configuration file on Windows:
# Create the config directoryNew-Item -ItemType Directory -Force -Path "$env:APPDATA\crucible"
# Create a basic config file@"kiln_path = "C:\Users\YourName\Documents\my-kiln"
[embedding]provider = "fastembed"model = "BAAI/bge-small-en-v1.5"batch_size = 16"@ | Out-File -FilePath "$env:APPDATA\crucible\config.toml" -Encoding utf8Or manually create the file at: C:\Users\YourName\AppData\Roaming\crucible\config.toml
Environment Variables
Section titled “Environment Variables”Override configuration using environment variables:
| Variable | Description |
|---|---|
CRUCIBLE_KILN_PATH | Path to your kiln |
CRUCIBLE_EMBEDDING_URL | Embedding provider API URL |
CRUCIBLE_EMBEDDING_MODEL | Embedding model name |
CRUCIBLE_EMBEDDING_PROVIDER | Provider type (fastembed, ollama, openai) |
CRUCIBLE_DATABASE_URL | Database connection URL |
CRUCIBLE_LOG_LEVEL | Logging level (off, error, warn, info, debug, trace) |
Building on Windows
Section titled “Building on Windows”Prerequisites
Section titled “Prerequisites”-
Rust toolchain: Install from rustup.rs
- Select “x86_64-pc-windows-msvc” (default)
- Or “x86_64-pc-windows-gnu” if you prefer MinGW
-
Visual Studio Build Tools (for MSVC toolchain):
- Install “Desktop development with C++” workload
- Or install Visual Studio Community with C++ support
-
Git: For cloning the repository
Build Commands
Section titled “Build Commands”# Build all crates (debug)cargo build
# Build releasecargo build --release
# Run testscargo test
# Run specific testcargo test -p crucible-llm --test test_backend_comparisonC Runtime Library Configuration
Section titled “C Runtime Library Configuration”On Windows, Rust uses the MSVC toolchain which requires consistent C runtime library linkage across all dependencies. You may encounter linker errors if dependencies are compiled with different runtime settings:
error LNK2038: mismatch detected for 'RuntimeLibrary':value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'Solution
Section titled “Solution”The project includes a .cargo/config.toml file that ensures consistent dynamic runtime linkage (the default on Windows). This matches most dependencies including:
- ONNX Runtime (
ort_sys) - used by FastEmbed - Most Rust crates on Windows
Troubleshooting Runtime Mismatch
Section titled “Troubleshooting Runtime Mismatch”If you see LNK2038 errors:
-
Clean and rebuild (most common fix):
Terminal window cargo cleancargo build -
Verify
.cargo/config.tomlexists and uses dynamic runtime (default) -
Rebuild dependencies from source if needed:
Terminal window cargo cleancargo build --verbose -
If the issue persists, consider:
- Using a different embedding provider (e.g., Ollama instead of FastEmbed)
- Checking for updated dependency versions
ONNX Runtime (FastEmbed) Issues
Section titled “ONNX Runtime (FastEmbed) Issues”FastEmbed uses ONNX Runtime for local embedding generation. On Windows, this can cause C runtime library mismatches.
Diagnostic Steps
Section titled “Diagnostic Steps”-
Run the diagnostic test:
Terminal window cargo test -p crucible-llm --features fastembed --test test_onnx_windows_diagnostics -- --nocapture -
Verify build configuration: Ensure
.cargo/config.tomlcontains:[target.'cfg(windows)']rustflags = ["-C", "target-feature=-crt-static"] -
Verify Visual C++ Redistributable: Check for
msvcp140.dllandvcruntime140.dllinC:\Windows\System32\If missing, install from: https://aka.ms/vs/17/release/vc_redist.x64.exe
Alternative Providers
Section titled “Alternative Providers”If ONNX Runtime issues persist, use alternative embedding providers:
- Ollama: Local or remote, requires Ollama server
- llama.cpp: GGUF models, excellent Windows support
- OpenAI/Anthropic: Cloud-based APIs
All providers work on Windows and can be configured in config.toml.
Common Issues
Section titled “Common Issues”Missing DLLs
Section titled “Missing DLLs”If you get “missing DLL” errors at runtime:
- Install Visual C++ Redistributable
- Ensure all dependencies are in your PATH
- For ONNX Runtime, ensure
onnxruntime.dllis accessible
Long Path Issues
Section titled “Long Path Issues”If you encounter path length errors:
- Enable long path support in Windows (requires admin):
Terminal window New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force - Or use shorter paths for your kiln directory
Path Handling
Section titled “Path Handling”Windows paths are handled automatically:
- Forward slashes (
/) are converted to backslashes (\) where needed - UNC paths (
\\server\share) are supported - Long paths (260+ characters) require Windows 10+ with long path support enabled
Testing on Windows
Section titled “Testing on Windows”Tests are designed to work cross-platform:
- Path separators are normalized automatically
- Line endings (CRLF vs LF) are handled transparently
- File watching may have different timing on Windows
# All testscargo test
# Specific cratecargo test -p crucible-llm
# With outputcargo test -- --nocapture
# ONNX Runtime diagnostic testcargo test -p crucible-llm --features fastembed --test test_onnx_windows_diagnostics -- --nocapturePerformance Considerations
Section titled “Performance Considerations”- File watching: Windows file system events may have different latency than Linux
- Embedding models: ONNX Runtime performance is similar across platforms
- Database: SQLite performance is consistent on Windows
See Also
Section titled “See Also”- Getting Started - General setup guide
- embedding - Embedding provider configuration
- storage - Database configuration