### LLM Checker Quick Start Workflow Source: https://github.com/pavelevich/llm-checker/blob/main/README.md This sequence demonstrates the basic workflow for new users of LLM Checker. It covers installation, hardware detection, getting recommendations by category, and running a model with auto-selection based on a prompt. It assumes Node.js and Ollama are installed. ```bash # 1) Install npm install -g llm-checker # 2) Detect your hardware llm-checker hw-detect # 3) Get recommendations by category llm-checker recommend --category coding # 4) Run with auto-selection llm-checker ai-run --category coding --prompt "Write a hello world in Python" ``` -------------------------------- ### LLM Checker Quick Start Commands Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Basic commands to get started with LLM Checker. These include detecting hardware, performing a full analysis, getting model recommendations, and syncing/searching the database. ```bash # 1. Detect your hardware capabilities llm-checker hw-detect # 2. Get full analysis with compatible models llm-checker check # 3. Get intelligent recommendations by category llm-checker recommend # 4. (Optional) Sync full database and search llm-checker sync llm-checker search qwen --use-case coding ``` -------------------------------- ### Automate Developer Environment Setup Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Streamline developer setup by automating the analysis and installation of recommended LLM models. This script uses LLM Checker to identify suitable models for coding tasks and then automatically pulls the top recommended models using Ollama. ```bash #!/usr/bin/env bash # setup-dev-environment.sh echo "🔍 Analysing hardware…" llm-checker check --use-case code --filter medium --ollama-only > analysis.txt # Extract recommended installation commands INSTALL_COMMANDS=$(grep "ollama pull" analysis.txt) echo "📦 Installing recommended models…" echo "$INSTALL_COMMANDS" | head -3 | while read cmd; echo "Running: $cmd" $cmd done echo "âś… Development environment ready" ``` -------------------------------- ### Get Help for LLM Checker Commands Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md This provides instructions on how to access help documentation for llm-checker commands. It's useful for discovering all available options and parameters for `ai-check` and `ai-run`. ```bash llm-checker ai-check --help llm-checker ai-run --help ``` -------------------------------- ### Compare Installed Models with LLM Checker Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md This snippet retrieves a list of installed Ollama models and then uses llm-checker to perform an AI check on them. It's useful for quickly assessing the compatibility or performance of your current model setup. ```bash MODELS=$(ollama list | tail -n +2 | awk '{print $1}' | tr '\n' ' ') llm-checker ai-check --models $MODELS ``` -------------------------------- ### Get Intelligent Model Recommendation (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md Checks your hardware and provides an intelligent recommendation for the best LLM model to use. It also allows listing available models and performing a broader system analysis. ```bash # Get intelligent recommendation for your hardware llm-checker ai-check # See what models are available locally llm-checker list-models # Get broader system analysis llm-checker check ``` -------------------------------- ### Install Optional sql.js for Database Features Source: https://github.com/pavelevich/llm-checker/blob/main/README.md This command installs the 'sql.js' package, which is optional but enables advanced database search features like 'sync', 'search', and 'smart-recommend' within the LLM Checker tool. This requires a prior Node.js installation. ```bash npm install sql.js ``` -------------------------------- ### Install Python Requirements (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/ml-model/README.md Installs the necessary Python packages required for the machine learning model development and training. ```bash cd ml-model pip install -r requirements.txt ``` -------------------------------- ### Benchmark All Installed Ollama Models Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Generate a comprehensive performance report for all installed Ollama models. This script lists available models, benchmarks each one using LLM Checker, and compiles the results into a Markdown file for easy review and comparison. ```bash echo "# Performance Report – $(date)" > performance-report.md ollama list | grep -v NAME | awk '{print $1}' | while read model; echo "## $model" >> performance-report.md llm-checker ollama --test "$model" >> performance-report.md echo "" >> performance-report.md done ``` -------------------------------- ### VS Code Task to Install Best Code Model Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Create a VS Code task to automate the installation of the best-suited LLM for coding tasks. This task pipes the output of `llm-checker` to `grep` and `head`, then executes the Ollama pull command for the top recommendation. ```json // .vscode/tasks.json { "version": "2.0.1", "tasks": [ { "label": "Install Best Code Model", "type": "shell", "command": "bash", "args": [ "-c", "llm-checker check --use-case code --ollama-only | grep 'ollama pull' | head -1 | bash" ], "group": "build" } ] } ``` -------------------------------- ### Enable Metal Backend for Apple Silicon Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Sets an environment variable to enable the Metal backend for accelerated performance on Apple Silicon (M1/M2/M3) chips. This is a performance optimization technique. ```bash export LLAMA_METAL=1 # Use Metal backend llm-checker check --filter small,medium --detailed | grep -A5 "Apple Silicon" ``` -------------------------------- ### Install LLM Checker from GitHub Packages (Legacy) Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Steps to install LLM Checker from GitHub Packages, including configuring npm registry and authentication token. This method is legacy and may lag behind npm releases. ```bash # 1) Configure registry + token (PAT with read:packages) echo "@pavelevich:registry=https://npm.pkg.github.com" >> ~/.npmrc echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc # 2) Install npm install -g @pavelevich/llm-checker@latest ``` -------------------------------- ### Build and Package Commands (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md Common npm commands for managing the llm-checker project, including starting the development server, running tests, building for distribution, and packaging for npm. ```bash # Development npm run dev # Testing npm test # Build for distribution npm run build # Package for npm npm pack ``` -------------------------------- ### Command Chaining for Workflows (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md Demonstrates how to chain LLM Checker commands together to create automated workflows, such as a complete discovery process or batch model testing. ```bash # Complete discovery workflow llm-checker check && \ llm-checker list-models --category coding && \ llm-checker ai-check --models codellama:7b deepseek-coder:6.7b # Automated model testing for model in llama2:7b mistral:7b phi3:mini; do echo "Testing $model:" llm-checker ai-check --models $model done ``` -------------------------------- ### Collect Benchmark Data (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/ml-model/README.md Starts the process of collecting performance benchmark data for various models on the current hardware. ```bash npm run benchmark ``` -------------------------------- ### Setup LLM Checker MCP with npx Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Alternative method to set up LLM Checker as an MCP server for Claude Code using npx, which does not require a global installation of LLM Checker. ```bash claude mcp add llm-checker -- npx llm-checker-mcp ``` -------------------------------- ### Install LLM Checker Globally or via npx Source: https://github.com/pavelevich/llm-checker/blob/main/README.md This snippet shows how to install the LLM Checker tool globally using npm or how to run it directly using npx without a global installation. It requires Node.js 16+. ```bash # Install globally npm install -g llm-checker # Or run directly with npx npx llm-checker hw-detect ``` -------------------------------- ### Unit Tests for Hardware Analysis and Model Scoring (JavaScript) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md Provides examples of unit tests for the hardware analysis and model scoring components. It includes tests for classifying hardware tiers and penalizing oversized models. ```javascript // Test hardware analysis describe('Hardware Analysis', () => { test('should classify high-end system correctly', () => { const hardware = { cpu_cores: 12, total_ram_gb: 24 }; const analysis = selector.analyzeHardware(hardware); expect(analysis.overall_tier).toBe('high'); }); test('should handle Apple Silicon correctly', () => { const hardware = { gpu_model_normalized: 'apple_silicon', total_ram_gb: 16 }; const analysis = selector.analyzeHardware(hardware); expect(analysis.gpu_tier.multiplier).toBeGreaterThan(1.0); }); }); // Test scoring algorithm describe('Model Scoring', () => { test('should penalize oversized models', () => { const smallHardware = { total_ram_gb: 8 }; const largeModel = { memory_requirement: 16 }; const score = selector.calculateModelScore(largeModel, smallHardware); expect(score).toBeLessThan(50); }); }); ``` -------------------------------- ### Semantic Search with llm-checker Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Illustrates setting up semantic search capabilities. It involves filtering for embedding models, pulling a suitable model like `all-minilm`, and generating embeddings for text. ```bash llm-checker check --filter embeddings ollama pull all-minilm echo "machine learning" | ollama run all-minilm "Generate embedding:" ``` -------------------------------- ### Find Fastest Models and Compare Performance (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md Identifies efficient LLM models based on performance and speed, and compares their performance profiles. This helps users find the best performance/speed ratio for their needs. ```bash # Find efficient models llm-checker list-models --popular --limit 20 # Compare performance profiles llm-checker ai-check --models phi3:mini mistral:7b gemma:7b # Test multiple sizes of same family llm-checker ai-check --models llama2:7b llama2:13b ``` -------------------------------- ### Configuration File for LLM Checker (JSON) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md An example of the configuration file (~/.llm-checker/config.json) used to customize the behavior of the llm-checker. It includes settings for model selection weights, cache TTL, and hardware detection. ```json // ~/.llm-checker/config.json { "selector": { "weights": { "memory_efficiency": 0.35, "performance_match": 0.25, "task_optimization": 0.20, "popularity_quality": 0.15, "resource_efficiency": 0.05 }, "cache_ttl": 300000, "fallback_enabled": true }, "hardware": { "force_detection": false, "custom_multipliers": { "apple_silicon": 1.15, "rtx_40_series": 1.3 } } } ``` -------------------------------- ### Execute llm-checker CLI Commands Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Demonstrates how to invoke llm-checker commands directly from the command line for scripting and automation. This includes examples for running analysis and searching the model catalog. ```bash llm-checker check --use-case coding --limit 3 llm-checker search "qwen coder" --json ``` -------------------------------- ### Compare Reasoning Models and Check Hardware (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md Compares LLM models suitable for complex reasoning tasks and checks hardware capabilities for running large models. It helps researchers identify models with strong reasoning performance. ```bash # Compare reasoning models llm-checker ai-check --models llama2:13b qwen2:7b mistral:7b # Get category-specific recommendations llm-checker recommend --category reasoning # Check what large models you can run llm-checker ai-check --models llama2:70b claude:20b gpt4:175b ``` -------------------------------- ### Get LLM Recommendations Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Retrieves general recommendations for all LLM categories using the LLM Checker CLI. This is useful for a broad overview of compatible models. ```bash llm-checker recommend ``` -------------------------------- ### Get Coding Model Recommendations Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Filters LLM recommendations to specifically find models suitable for coding tasks. This command narrows down the search to relevant models. ```bash llm-checker recommend --category coding ``` -------------------------------- ### Track Compatibility Trends Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Appends the current date and the number of compatible models to a CSV file for trend tracking. This helps in monitoring the compatibility over time. ```bash # Trend tracking echo "$(date),$(llm-checker check --quiet | grep 'Compatible:' | grep -o '[0-9]*')" >> compatibility-trends.csv ``` -------------------------------- ### Build AI Apps with llm-checker Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Demonstrates building AI applications using llm-checker. It includes checking models for chat use cases, pulling necessary models via Ollama, and making API calls for generation. ```bash llm-checker check --use-case chat --filter small,medium ollama pull $(llm-checker check --use-case chat | grep "ollama pull" | head -1 | cut -d' ' -f3) curl -X POST http://localhost:11434/api/generate -H "Content-Type: application/json" -d '{"model":"llama3.2:3b","prompt":"Hello!","stream":false}' ``` -------------------------------- ### Analyze Hardware Upgrade Potential (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md Assesses current hardware capabilities and shows which models can be run with more resources. This is useful for users considering hardware upgrades to unlock new LLM tiers. ```bash # Check current capabilities llm-checker check --detailed # See what models require more resources llm-checker list-models --full | grep "16.*GB\|32.*GB" # Compare small vs large models llm-checker ai-check --models phi3:mini llama2:7b llama2:13b llama2:70b ``` -------------------------------- ### Develop LLM Checker Locally Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Provides the steps to clone the LLM Checker repository, install its dependencies using npm, and run the enhanced CLI locally. This is for developers setting up the project. ```bash git clone https://github.com/Pavelevich/llm-checker.git cd llm-checker npm install node bin/enhanced_cli.js hw-detect ``` -------------------------------- ### Get High-Quality Reasoning Models Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Retrieves recommendations for LLM models optimized for reasoning tasks, focusing on high-quality outputs. This command targets specific use cases. ```bash llm-checker smart-recommend --use-case reasoning ``` -------------------------------- ### Compare RAM Configurations for LLM Performance Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Analyze the impact of different RAM configurations on LLM compatibility and performance. This script iterates through various RAM amounts, running LLM Checker for each, and reports the compatibility status, helping to determine optimal RAM settings. ```bash echo "RAM sensitivity test:" for ram in 8 16 32 64; echo "=== ${ram} GB RAM ===" LLM_CHECKER_RAM_GB=$ram llm-checker check --quiet | grep "Compatible:" done ``` -------------------------------- ### Generate LLM Checker MCP Setup Command Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Command to generate the specific integration command for adding LLM Checker as an MCP server to Claude Code. This avoids manual configuration. ```bash llm-checker mcp-setup ``` -------------------------------- ### Analyze Hardware and Model Selection (JavaScript) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md JavaScript code snippets for analyzing hardware and model selection within the LLM Checker. These examples help in diagnosing issues related to hardware capabilities and model performance scoring. ```javascript // Check if models are too large for hardware const analysis = selector.analyzeHardware(hardware); console.log('Available memory:', analysis.available_memory.total); ``` ```javascript // Enable verbose scoring const result = selector.selectBestModel(models, hardware, 'general'); console.log('All scores:', result.allPredictions); ``` -------------------------------- ### Compare Coding Models and Run AI Tasks (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md Compares coding-specific LLM models, lists models by category, and runs AI tasks with or without calibrated routing policies. This is useful for developers needing coding assistance. ```bash # Compare coding-specific models llm-checker ai-check --models codellama:7b deepseek-coder:6.7b starcoder:7b # Browse all coding models llm-checker list-models --category coding # Quick coding session llm-checker ai-run --prompt "Help me write a Python function to parse JSON" # Quick coding session with calibrated routing policy (auto-discovery) llm-checker ai-run --calibrated --category coding --prompt "Help me write a Python function to parse JSON" ``` -------------------------------- ### Get System Specifications (JavaScript) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md Asynchronously retrieves system specifications, prioritizing the 'systeminformation' library for detailed data and falling back to Node.js built-ins if necessary. Handles potential errors during detailed detection. ```javascript async getSystemSpecs() { // Try systeminformation first (most detailed) if (si) { try { const [cpu, mem, graphics, osInfo] = await Promise.all([ si.cpu(), si.mem(), si.graphics(), si.osInfo() ]); return this.processDetailedSpecs(cpu, mem, graphics, osInfo); } catch (error) { console.warn('Detailed detection failed, using fallback'); } } // Fallback to Node.js built-ins const os = require('os'); return { cpu_cores: os.cpus().length, cpu_freq_max: 3.0, // Estimated total_ram_gb: os.totalmem() / (1024 ** 3), gpu_model_normalized: os.platform() === 'darwin' ? 'apple_silicon' : 'cpu_only', gpu_vram_gb: os.platform() === 'darwin' ? os.totalmem() / (1024 ** 3) * 0.75 : 0, platform: os.platform() }; } ``` -------------------------------- ### Tune Quantization Levels Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Iterates through various quantization levels (e.g., Q2_K, Q4_0) and analyzes the model's performance with each. This helps in finding the optimal balance between performance and accuracy. ```bash for quant in Q2_K Q4_0 Q4_K_M Q5_0 Q8_0; do echo "=== $quant ===" llm-checker analyze --quantization $quant done ``` -------------------------------- ### Calibrate LLM Routing Policy (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md Generates a calibration contract and routing policy for LLM models based on a provided suite of test cases. This allows for deterministic routing using measured policies. ```bash # Use repository fixture (or your own JSONL suite) cp ./docs/fixtures/calibration/sample-suite.jsonl ./sample-suite.jsonl # Generate calibration contract + routing policy llm-checker calibrate \ --suite ./sample-suite.jsonl \ --models qwen2.5-coder:7b llama3.2:3b \ --runtime ollama \ --objective balanced \ --dry-run \ --output ./artifacts/calibration-result.json \ --policy-out ./artifacts/calibration-policy.yaml # Route recommend/ai-run through calibrated policy llm-checker recommend --calibrated ./artifacts/calibration-policy.yaml --category coding llm-checker ai-run --calibrated ./artifacts/calibration-policy.yaml --category coding --prompt "Refactor this function" ``` -------------------------------- ### Enable OpenCL Fallback for AMD GPUs Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Verifies AMD GPU status using `rocm-smi` and sets an environment variable to use OpenCL as a fallback for AMD GPUs. This is for performance optimization on AMD hardware. ```bash rocm-smi # Verify ROCm export LLAMA_OPENCL=1 # OpenCL fallback ``` -------------------------------- ### Environment Variables for LLM Checker (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md Examples of environment variables that can be used to configure the llm-checker CLI. These include options for enabling debug mode, disabling cache, and specifying a custom model database path. ```bash # Enable debug mode DEBUG=1 llm-checker ai-check # Disable hardware caching NO_CACHE=1 llm-checker ai-check # Custom model database path MODEL_DB_PATH=/path/to/custom/models.json llm-checker ai-check ``` -------------------------------- ### Select Models with DeterministicModelSelector Source: https://context7.com/pavelevich/llm-checker/llms.txt Illustrates the usage of `DeterministicModelSelector` to get hardware profiles and select optimal LLM models based on a 4D scoring system. It shows how to specify target context, optimization profile, and runtime, and details the structure of the returned model candidates. ```javascript const DeterministicModelSelector = require('llm-checker/src/models/deterministic-selector'); const selector = new DeterministicModelSelector(); // Get hardware profile const hardware = await selector.getHardware(); // Returns: { cpu, gpu, memory, acceleration, usableMemGB } // Select models for a specific category const result = await selector.selectModels('coding', { targetCtx: 8192, // Target context window topN: 5, // Number of top candidates enableProbe: false, // Enable quick performance probes optimizeFor: 'quality', // Optimization profile runtime: 'ollama' // Runtime backend }); // Result structure: // { // category: 'coding', // candidates: [{ meta, quant, requiredGB, estTPS, score, components: {Q,S,F,C} }], // hardware: {...}, // total_evaluated: 150 // } ``` -------------------------------- ### Setup LLM Checker MCP Server for Claude Code Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Instructions for integrating LLM Checker with Claude Code using the Model Context Protocol (MCP). This allows Claude Code to manage local models via LLM Checker. ```bash # Install globally first npm install -g llm-checker # Add to Claude Code claude mcp add llm-checker -- llm-checker-mcp ``` -------------------------------- ### Vim/Neovim Lua Function to Install Best Model Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Add a Lua function to Vim/Neovim to automatically install the best LLM for coding tasks. This function retrieves the recommended Ollama pull command using `llm-checker` and executes it, simplifying model setup. ```lua -- lua/llm-checker.lua local M = {} function M.install_best_model() local cmd = vim.fn.system("llm-checker check --use-case code --ollama-only | grep 'ollama pull' | head -1") if cmd ~= '' then vim.fn.system(cmd) print('Installed model: ' .. cmd) end end return M ``` -------------------------------- ### Initialize and Analyze with LLMChecker Source: https://context7.com/pavelevich/llm-checker/llms.txt Demonstrates how to initialize the `LLMChecker` class and perform a full hardware analysis and model compatibility check. It shows how to filter models by use case, size, and runtime, and access the compatibility results, recommendations, and hardware profile. ```javascript const LLMChecker = require('llm-checker'); const checker = new LLMChecker({ verbose: true }); // Run full hardware analysis and model compatibility check const results = await checker.analyze({ filter: 'coding', // Filter by use case: 'coding', 'chat', 'multimodal', 'embeddings' includeCloud: false, // Include cloud models in analysis maxSize: 14, // Maximum model size in billions of parameters minSize: 3, // Minimum model size in billions of parameters useCase: 'general', // Use case for optimization optimizeFor: 'balanced', // Optimization profile: 'balanced', 'speed', 'quality', 'context' runtime: 'ollama' // Runtime backend: 'ollama', 'vllm', 'mlx' }); console.log(results.compatible); // Array of compatible models console.log(results.recommendations); // AI-generated recommendations console.log(results.hardware); // Detected hardware profile ``` -------------------------------- ### Run ML Training Pipeline for Performance Benchmarking Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md This bash script outlines the steps for contributing to llm-checker's performance benchmarking. It includes commands to collect performance data, process and label it, train a TabTransformer model, and use the trained model for predictions. ```bash # Collect performance data npm run benchmark # Process and label data cd ml-model && python python/dataset_aggregator.py # Train TabTransformer model npm run train-ai # Use trained model for predictions llm-checker ai-check --status ``` -------------------------------- ### Define Custom Models for llm-checker Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md A JavaScript module defining an array of custom models. Each model object specifies its name, size, type, requirements, supported frameworks, and installation instructions. ```javascript // custom-models.js module.exports = [ { name: "MyCustom Model 7B", size: "7B", type: "local", category: "medium", requirements: { ram: 8, vram: 4, cpu_cores: 4, storage: 7 }, frameworks: ["ollama"], installation: { ollama: "ollama pull mycustom:7b" } } ]; ``` -------------------------------- ### Detect System Hardware with HardwareDetector Source: https://context7.com/pavelevich/llm-checker/llms.txt Shows how to use the `HardwareDetector` class to retrieve detailed information about the system's hardware, including CPU, memory, GPU, and OS details. It also demonstrates how to simulate hardware for testing purposes. ```javascript const HardwareDetector = require('llm-checker/src/hardware/detector'); const detector = new HardwareDetector(); const systemInfo = await detector.getSystemInfo(); // Hardware profile structure: // { // cpu: { brand, cores, physicalCores, speed, architecture, score }, // memory: { total, free, used, available, score }, // gpu: { model, vendor, vram, dedicated, gpuCount, isMultiGPU, score }, // os: { platform, distro, arch }, // timestamp: Date.now() // } // Simulate hardware for testing detector.setSimulatedHardware({ cpu: { brand: 'Apple M4 Pro', cores: 14, architecture: 'Apple Silicon' }, memory: { total: 48 }, gpu: { model: 'Apple M4 Pro GPU', vram: 0, unified: true } }); ``` -------------------------------- ### Check Specific Model Candidates with LLM Checker Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/usage-guide.md This command allows you to compare a specific set of models using llm-checker. It's more targeted than checking all installed models and is useful for direct comparisons between selected candidates. ```bash llm-checker ai-check --models model1 model2 model3 ``` -------------------------------- ### Smart Select and Run (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/ml-model/README.md Initiates a smart model selection process based on a prompt. Allows specifying candidate models for selection. ```bash npm run ai-run -- --prompt "Explain machine learning" ``` ```bash npm run ai-run -- --models llama2:7b mistral:7b --prompt "Summarize this file" ``` -------------------------------- ### Initialize Enterprise Policy Template Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Generates a `policy.yaml` template file for defining enterprise governance policies. This command is the first step in setting up policy management. ```bash llm-checker policy init ``` -------------------------------- ### Analyze Model with llm-checker Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Command to analyze a specific language model. It takes the model name as an argument. ```bash llm-checker analyze-model "TinyLlama 1.1B" ``` -------------------------------- ### GitHub Actions Policy Gate Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Example workflow for integrating LLM Checker policy gates into GitHub Actions. ```APIDOC ## GitHub Actions Policy Gate ### Description This example demonstrates how to set up a GitHub Actions workflow to gate pull requests based on LLM Checker policies. It runs the `check` command and uploads policy audit reports as artifacts. ### Workflow Example ```yaml name: Policy Gate on: [pull_request] jobs: policy-gate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - run: npm ci - run: node bin/enhanced_cli.js check --policy ./policy.yaml --runtime ollama --no-verbose - if: always() run: node bin/enhanced_cli.js audit export --policy ./policy.yaml --command check --format all --runtime ollama --no-verbose --out-dir ./policy-reports - if: always() uses: actions/upload-artifact@v4 with: name: policy-audit-reports path: ./policy-reports ``` ``` -------------------------------- ### Sanitize Logs with Hardware Anonymization Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Runs the llm-checker check command with the `--anonymize-hardware` flag to sanitize logs by removing hardware-specific information, enhancing privacy. ```bash llm-checker check --anonymize-hardware > safe-report.txt ``` -------------------------------- ### Generate Reports in JSON, HTML, and CSV Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Commands to generate detailed reports from llm-checker in various formats: JSON, HTML, and CSV. This is useful for automated reporting and analysis. ```bash llm-checker check --detailed --export json > report.json llm-checker check --detailed --export html > report.html llm-checker check --detailed --export csv > report.csv ``` -------------------------------- ### Analyze Ollama Adoption Metrics Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Uses `jq` to parse Ollama's model list in JSON format and extract adoption metrics like name, size, and last used date. It also finds the maximum tokens per second from benchmark results. ```bash llm-checker ollama --list --format json | jq '.[] | {name, sizeGB: .fileSizeGB, lastUsed: .modified}' find ~/.llm-checker/benchmarks -name "*.json" | xargs jq '.tokensPerSecond' | sort -n ``` -------------------------------- ### Enable CUDA GPU Acceleration Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Verifies NVIDIA GPU status using `nvidia-smi` and then enables CUDA GPU acceleration for llm-checker. This is crucial for performance on NVIDIA hardware. ```bash nvidia-smi # Verify CUDA llm-checker check --gpu-acceleration cuda ``` -------------------------------- ### Intelligent Selector Lazy Loading (JavaScript) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md Demonstrates a lazy loading pattern for initializing the model database and hardware tiers within the IntelligentSelector class. Properties are only initialized upon their first access. ```javascript class IntelligentSelector { constructor() { this._modelDatabase = null; this._hardwareTiers = null; } get modelDatabase() { if (!this._modelDatabase) { this._modelDatabase = this.initializeModelDatabase(); } return this._modelDatabase; } } ``` -------------------------------- ### Load Custom Plugins for llm-checker Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Sets an environment variable to specify the directory for llm-checker plugins and then loads these plugins using the `--load-plugins` flag. This extends the functionality of llm-checker. ```bash export LLM_CHECKER_PLUGINS_DIR=~/.llm-checker/plugins llm-checker check --load-plugins ``` -------------------------------- ### CLI Commands Reference (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/ml-model/README.md Provides a comprehensive list of command-line interface commands for interacting with the llm-checker tool, including evaluation, selection, and training utilities. ```bash # AI-powered meta evaluation llm-checker ai-check ``` ```bash # Category-driven evaluation llm-checker ai-check --category coding --top 12 ``` ```bash # Smart model selection + run llm-checker ai-run --prompt "Hello world" ``` ```bash # Restrict ai-run candidates llm-checker ai-run --models llama2:7b mistral:7b --prompt "Refactor this" ``` ```bash # Training utilities npm run benchmark npm run train-ai ``` -------------------------------- ### Update LLM Checker from GitHub Packages to npm Source: https://github.com/pavelevich/llm-checker/blob/main/README.md Instructions to uninstall the legacy GitHub Packages version of LLM Checker and install the latest version from npm. This ensures you have the most recent release. ```bash npm uninstall -g @pavelevich/llm-checker npm install -g llm-checker@latest hash -r llm-checker --version ``` -------------------------------- ### Train AI Model (Bash) Source: https://github.com/pavelevich/llm-checker/blob/main/ml-model/README.md Initiates the training pipeline for the AI model. This includes data collection, aggregation, and model training. ```bash npm run train-ai ``` -------------------------------- ### Handle Apple Silicon Memory (JavaScript) Source: https://github.com/pavelevich/llm-checker/blob/main/docs/reference/technical-docs.md Optimizes hardware detection for Apple Silicon by accounting for its unified memory architecture. It estimates GPU-accessible memory and available system memory, applying a performance boost multiplier. ```javascript handleAppleSilicon(totalRAM) { // Apple Silicon uses unified memory architecture const unifiedMemory = totalRAM; // Estimate GPU-accessible memory (60% of total) const gpuMemory = unifiedMemory * 0.6; // System overhead (30% reserved for macOS) const availableMemory = unifiedMemory * 0.7; return { total_ram_gb: unifiedMemory, gpu_vram_gb: gpuMemory, available_memory: availableMemory, gpu_model_normalized: 'apple_silicon', architecture_boost: 1.15 // 15% performance bonus }; } ``` -------------------------------- ### AIModelSelector Class (JavaScript) Source: https://github.com/pavelevich/llm-checker/blob/main/ml-model/README.md Demonstrates the usage of the AIModelSelector class for initializing the model and predicting the best model based on system specifications. ```javascript const selector = new AIModelSelector(); // Initialize (loads ONNX model) await selector.initialize(); // Select best model const result = await selector.predictBestModel( ['llama2:7b', 'mistral:7b'], systemSpecs ); // Fallback selection const fallback = selector.selectModelHeuristic(models, specs); ``` -------------------------------- ### Enable Fully Offline Mode Source: https://github.com/pavelevich/llm-checker/blob/main/docs/guides/advanced-usage.md Sets environment variables to enforce fully offline operation and disable update checks for llm-checker. It also runs the check command with offline and no-cloud flags. ```bash export LLM_CHECKER_OFFLINE=1 export LLM_CHECKER_NO_UPDATE_CHECK=1 llm-checker check --offline --no-cloud ``` -------------------------------- ### Recommend Models Source: https://github.com/pavelevich/llm-checker/blob/main/README.md The `recommend` command helps you find suitable LLM models based on various optimization profiles. It analyzes available models and provides recommendations with scores and pull commands. ```APIDOC ## `recommend` — Category Recommendations ### Description Use optimization profiles to steer ranking by intent and get categorized model recommendations. ### Method CLI Command ### Endpoint N/A (CLI Tool) ### Parameters #### Query Parameters - **--optimize** (string) - Optional - Specifies the optimization profile to use. Options include: `balanced`, `speed`, `quality`, `context`, `coding`. ### Request Example ```bash llm-checker recommend --optimize quality ``` ### Response #### Success Response (Output) - **Category** (string) - The category of the recommendation (e.g., Coding, Reasoning, Multimodal). - **Model Name** (string) - The name of the recommended model. - **Parameter Count** (string) - The size of the model in billions of parameters. - **Score** (number) - The model's score out of 100 based on the selected optimization profile. - **Command** (string) - The command to pull the model using Ollama. #### Response Example ``` INTELLIGENT RECOMMENDATIONS BY CATEGORY Hardware Tier: HIGH | Models Analyzed: 205 Coding: qwen2.5-coder:14b (14B) Score: 78/100 Command: ollama pull qwen2.5-coder:14b Reasoning: deepseek-r1:14b (14B) Score: 86/100 Command: ollama pull deepseek-r1:14b ``` ```