Installation
Make sure you have the MultiMind package installed:The multimind Command
Installing the package adds a multimind entry point with the following command groups:
audit, backend, chat, compliance, config, dashboard, models, serve.
Two extra commands are dispatched before the Click group and therefore do not appear in multimind --help: multimind convert and multimind context-transfer. Both are documented under Model Conversion and Context Transfer below.
Model Management
models metrics reads the gateway’s ModelMonitor (multimind.core.monitoring), which is an in-memory, per-process object fed by /v1/chat and /v1/generate requests. A fresh CLI process has its own empty monitor, so the command prints empty tables unless it runs inside the same process as the server; to see live gateway numbers query GET /v1/metrics on the running server instead.
Chat Sessions
Configuration
Compliance
PII Text Scanning
Scan text or a file for PII using the ComplianceGuard detector. Exits with code 1 if any PII is found, which makes it usable in CI pipelines.--file,-f: Scan a file instead of inline text--redact,-r: Also print the text redacted with this strategy (mask,hash, orremove)
Monitoring, Reports, and Alerts
compliance dashboard and compliance alerts read the same in-process store as the /v1/compliance/dashboard and /v1/compliance/alerts routes: one ComplianceShard per organization, held for the life of the backend process and filled by POST /v1/compliance/monitor calls (multimind/gateway/compliance_api.py). Nothing is persisted to disk, so a CLI invocation in its own process reports zero checks and no alerts; use the routes on the running server (multimind backend) to see what that process recorded.
Compliance Proxy Server
Start the OpenAI-compatible compliance proxy. Point any existing OpenAI client’sbase_url at this proxy to get PII redaction, budget enforcement, and an audit trail with zero code changes.
--host: Bind host (default 127.0.0.1)--port,-p: Bind port (default 8400)--upstream: Named upstream provider:openai,groq,mistral,gemini,deepseek,ollama--upstream-base-url: Custom OpenAI-compatible upstream URL (overrides--upstream)--strategy: PII redaction strategy:mask,hash, orremove(defaultmask)--block-on: Comma-separated PII types that reject the request, e.g.ssn,credit_card--budget: Max session spend in USD--audit-log: Path for the JSONL audit trail--costs-log: Path for the JSONL cost log (defaultcosts.jsonl)--scan-output/--no-scan-output: Also redact PII in model output (default on)--config: Guardrails JSON file authored viamultimind dashboard
MULTIMIND_PROXY_* environment variables; see the Configuration Guide.
Governance Dashboard
Serve a read-only local web UI over the guard audit trail, cost log, shadow-AI inventory, and a no-code guardrails editor whose output feedsmultimind serve --config:
Backend API Server
Serve every supported REST route (gateway, governance, guard proxy, RAG when installed) from one process with one Swagger UI at/docs:
AI Usage Audit
Shadow-AI Inventory Scan
Scan a project directory for AI usage. Exits with code 1 if hardcoded AI API keys are found.--include-env: Also report which known AI env keys are set (names only, never values)--json: Machine-readable JSON output
Cost Chargeback Report
Per-tag chargeback report from the session tracker or a JSONL log.--log: Rebuild the tracker from a persisted JSONL cost log (e.g.costs.jsonl)--period: Filter by ISO timestamp prefix, e.g.2026-07
Model Conversion
multimind convert wraps ModelConversionManager (multimind/model_conversion). It is dispatched before the Click group, so it is absent from multimind --help, and it imports torch, so it needs the finetune extra:
--source: Source format:huggingface,pytorch,tensorflow,onnx, orollama--target: Target format:gguf,safetensors,tflite,ort, oronnx--model-path: Path to the source model or a HuggingFace model ID--output-dir: Directory for the converted model (created if missing)
--quantization:q4_k_m,q4_0,q5_k_m,q8_0,int8, orfp16--compression:lz4orzstd(Safetensors);--compression-level1-9 (default 9)--optimizations: One or more optimization names, e.g.DEFAULT OPTIMIZE_FOR_LATENCY(TFLite)--optimization-level:basic,all, orextreme(ONNX Runtime)--device:cpu(default) orcuda--context-length: Context length for GGUF output--metadata: One or morekey=valuepairs attached to the output--validate: Validate the model before and after conversion (a failed validation exits 1)--test: Run the converted model; implemented forggufonly, other targets print “not implemented”--verbose: Print source and converted model metadata, and a traceback on error
Context Transfer
multimind context-transfer reformats a saved conversation from one provider into a prompt for another (multimind.context_transfer). It is dispatched before the Click group, needs no extras, and uses argparse-style underscore options.
--from_model, --to_model, --input_file, and --output_file are all required for a transfer; the command exits 2 if one is missing):
--from_model,--to_model: Source and target model names, e.g.chatgpt,claude,deepseek,gemini,mistral; see--list_models--input_file: Conversation history file (the output directory is created if needed)--output_file: Where the formatted prompt is written--last_n: Number of recent turns to extract (default 5)--no_summary: Skip summarization and use only the last message--summary_type:concise(default),detailed, orstructured--smart_extraction: Importance-based context extraction--output_format:txt(default),json, ormarkdown
--include_code_context, --include_reasoning, --include_safety, --include_creativity, --include_examples, --include_step_by_step, --include_multimodal, --include_web_search.
Information and general options:
--list_models: List supported models and exit--model_info MODEL: Show one model’s capabilities and exit--verbose,-v: Debug logging and a traceback on unexpected errors
Example CLI Scripts
The repository also ships standalone example scripts underexamples/cli/ (run from a checkout of the repository, not the installed package).
Ensemble System
Text Generation
Generate text using an ensemble of models:--providers,-p: Provider to use; repeat the flag for multiple (default: openai, anthropic, ollama)--method,-m: Ensemble method to use (default: weighted_voting)--output,-o: Output file path (optional)
Code Review
Review code using an ensemble of models:--providers,-p: Provider to use; repeat the flag for multiple (default: openai, anthropic, ollama)--output,-o: Output file path (optional)
Image Analysis
Analyze images using an ensemble of models:--providers,-p: Provider to use; repeat the flag for multiple (default: openai, anthropic, ollama)--prompt,-q: Instruction sent to vision models (optional)--output,-o: Output file path (optional)
Embedding Generation
Generate embeddings using an ensemble of models:--providers,-p: Provider to use; repeat the flag for multiple (default: openai, ollama, huggingface)--model,-m: Model to use (provider-specific; optional)--output,-o: Output file path (optional)
Model Wrapper
Query various LLM models directly:--list-models: List all available models and exit--model: Model to use (choices: dynamically loaded from available models)--prompt: Your input prompt--temperature: Sampling temperature (default: 0.7)--max-tokens: Maximum tokens to generate
Ollama Chat Interface
Interactive chat with Ollama models:--model: Ollama model to use (default: mistral)--history: Path to save chat history (optional)--no-stream: Disable streaming responses--debug: Enable debug logging
exit: Exit the chathistory: Show chat historymodels: List available modelsclear: Clear chat historypull MODEL_NAME: Pull a new model
Compliance and Governance
Manage compliance and governance features:ingest, validate-output, monitor-anomalies, export-logs, dsar, model-approve, policy-publish, audit-verify, plugin-register, test-run, drift-check, and risk-override.
DSAR (Data Subject Access Request)
Model Approval
Policy Management
Audit Verification
Basic Agent
Run a basic agent with different models:Task Runner
Run predefined task workflows:Prompt Chain
Run a code review prompt chain:Output Format
The ensemble CLI commands output JSON data with the following structure:Available Ensemble Methods
weighted_voting: Combines results based on provider weightsconfidence_cascade: Uses results based on confidence thresholdsparallel_voting: Combines results from all providers in parallelmajority_voting: Uses the most common result among providersrank_based: Selects results based on provider ranking
Environment Variables
The CLI uses the following environment variables (should be set in your.env file):
OPENAI_API_KEY: Your OpenAI API keyANTHROPIC_API_KEY: Your Anthropic API key (CLAUDE_API_KEYis also accepted)MISTRAL_API_KEY: Your Mistral API key (if using Mistral AI)GROQ_API_KEY: Your Groq API key (if using Groq)GEMINI_API_KEY: Your Gemini API key (GOOGLE_API_KEYis also accepted)DEEPSEEK_API_KEY: Your DeepSeek API keyHUGGINGFACE_API_KEY: Hugging Face token for gated models (optional)OLLAMA_HOST: Ollama server URL (default:http://localhost:11434)
MULTIMIND_PROXY_* variables read by multimind serve.
Error Handling
The CLI provides clear error messages for common issues:- Missing API keys
- Invalid file paths
- Unsupported providers
- Invalid ensemble methods
- Model availability issues
- Compliance and governance errors
Examples
See the following example files for comprehensive usage:examples/ensemble/usage_examples.py: Ensemble system examplesexamples/cli/basic_agent.py: Basic agent examplesexamples/cli/task_runner.py: Task workflow examplesexamples/cli/prompt_chain.py: Prompt chain examples
