Moltis Documentation

repository·main·Indexed 25 days ago

https://github.com/moltis-org/moltis

A secure, persistent personal agent server written in Rust providing a sandboxed environment for AI agents. Features include Moltis Courier for Apple Push Notification Service (APNs) relay, a native macOS SwiftUI application, and the ascii-video skill for converting audio, video, and text into colored ASCII video files via a CPU-based rendering pipeline.

Tokens
273.8K
Snippets
635
Records
1.3K
Agent score
81%

What's inside Moltis

  1. Overview of Moltis

    main

    Moltis is a secure, local-first, persistent agent server written in Rust. It acts as a single binary interface between a user and multiple LLM providers, providing a unified agent that can be accessed via various channels (Web UI, API, Telegram, Discord, WhatsApp, Teams, and voice).

    Key capabilities include:

    • Durable Sessions: Long-term memory with hybrid vector and full-text search, session recall, and branching.
    • Tool Use: Support for MCP (Model Context Protocol), browser automation, and scheduling.
    • Security: Sandboxed execution, encrypted vaults for secrets (passwords, passkeys, tokens), and filesystem isolation.
    • Connectivity: A gateway server architecture that connects multiple frontends to a central agent loop, tools, and providers.
  2. Overview of Generic Webhooks in Moltis

    main

    Moltis supports generic webhooks as a first-class feature for machine event ingress. Unlike channels (which are human-facing messaging surfaces), webhooks allow you to create named inbound HTTP endpoints that trigger AI agents in response to external events (e.g., GitHub PRs, Stripe payments, or CI/CD pipelines).

    Each webhook acts as a public endpoint with a high-entropy identifier and is composed of:

    • A source profile (defines authentication, event parsing, and response actions).
    • A verification policy.
    • An event filter.
    • A delivery log.
    • An execution target (an existing agent_id plus optional local overrides).

    Webhooks are managed exclusively in Settings → Webhooks in the web UI.

  3. Overview of Unsloth features

    main

    Unsloth is an open-source framework for LLM fine-tuning and reinforcement learning (RL). It is designed to train, run, evaluate, and save models like Llama, DeepSeek, Qwen, Mistral, and Gemma 2x faster with 70% less VRAM.

    Key Capabilities:

    • Training Modes: Supports full-finetuning, pretraining, 4-bit, 16-bit, and 8-bit training.
    • Model Support: Supports vision models, text-to-speech (TTS), BERT, and multimodal models. Any model compatible with transformers works in Unsloth.
    • Reinforcement Learning: Highly efficient RL library using 80% less VRAM, supporting GRPO, GSPO, etc.
    • Hardware Support: Works on Linux, Windows, Colab, Kaggle, NVIDIA, AMD, and Intel GPUs.
    • Accuracy: Provides 0% loss in accuracy using exact methods (no approximations).
  4. Overview of ASCII Video Skill

    main

    The ascii-video skill enables agents to build single-file Python renderers that convert various inputs (audio, video, images, text, or mathematical functions) into colored ASCII character video files (MP4/GIF/PNG).

    Key capabilities:

    • Output: Actual video files (not terminal escape codes) at 1080p 24fps by default.
    • Rendering: Uses a pipeline of grid systems, font rasterization, shader chains, and ffmpeg encoding.
    • Hardware: No GPU required; all computations are CPU-based.
  5. Overview of the p5.js Production Pipeline

    main

    The p5.js production pipeline is a workflow for creating interactive and generative visual art in the browser. It supports various modes including generative art, data visualization, interactive experiences, animation, 3D scenes, image processing, and audio-reactive visuals. The pipeline follows a 6-stage process:

    1. CONCEPT: Articulate the creative vision (mood, color, motion).
    2. DESIGN: Choose mode, canvas size, interaction model, and export format.
    3. CODE: Write a single HTML file with inline p5.js using the structure: globals → preload()setup()draw() → helpers → classes → event handlers.
    4. PREVIEW: Open in browser to verify visual quality and performance.
    5. EXPORT: Capture output using saveCanvas(), saveGif(), saveFrames(), or Puppeteer.
    6. VERIFY: Ensure the output matches the concept and is visually striking.
  6. Overview of the p5.js Skill

    main
    The p5.js Skill is a production pipeline for creating interactive and generative visual art using p5.js. It allows an agent to handle the full creative pipeline: concept generation, code generation, previewing, exporting, and iterative refinement. The primary output is a single, self-contained HTML file that runs in any browser without requiring a build step, server, or local dependencies (relying instead on CDN script tags).
  7. Understand Moltis Authentication Architecture

    main

    Moltis uses a unified authentication gate via the auth_gate middleware. All HTTP requests pass through this middleware, which calls check_auth() to determine access. This single source of truth ensures consistent authentication logic across all routes.

    Authentication Flow:

    1. Public paths (e.g., /health, /assets/*, /api/auth/*) are passed through.
    2. If no credential store exists, requests pass through.
    3. Otherwise, check_auth() is called:
      • Allowed: AuthIdentity is inserted into the request.
      • SetupRequired: Returns 401 (API/WS) or redirects to /onboarding (pages).
      • Unauthorized: Returns 401 (API/WS) or serves the SPA login page (pages).

    WebSocket connections use check_auth() for the initial HTTP upgrade handshake. Post-upgrade, WebSockets support param-based authentication for clients unable to set HTTP headers.

  8. Architecture of the Tauri Native IPC Desktop Plan

    main

    The Moltis desktop implementation aims to replace the standard localhost HTTP/WebSocket transport used in server mode with native Tauri IPC (commands and events). This allows the desktop application to run without binding a local network listener, improving security and performance.

    Runtime Modes

    • Server mode (existing): Uses HTTP + WS transport via Axum routes.
    • Desktop mode (new): Uses Tauri command/event transport with no HTTP/WS transport for the UI.

    Transport Abstraction Layers

    To support both modes, the architecture uses a dual-layer abstraction:

    Rust (Backend)

    Core logic is decoupled from transport via a FrontendTransport trait.

    • WebSocketTransport: The current implementation for browser/server modes.
    • TauriIpcTransport: The new implementation for desktop mode.

    JavaScript/TypeScript (Frontend)

    All UI pages interact with a unified transport module interface rather than calling fetch or WebSocket directly. This allows the UI to switch between a Browser adapter and a Tauri adapter (invoke, event listeners) seamlessly.

    Key interface methods include:

    • call(method, params)
    • onEvent(event, handler)
    • stream(method, params, onChunk)
  9. Understand Reinforcement Learning (RL) concepts for model training

    main

    Reinforcement Learning (RL) is a training method where an agent learns to make decisions by interacting with an environment and receiving feedback via rewards or penalties.

    Key components include:

    • Action: The output generated by the model (e.g., a sentence).
    • Reward: A signal indicating the quality of the action (e.g., did the response follow instructions?).
    • Environment: The task or scenario the model is performing (e.g., answering a user question).
    • Reward Function: The logic used to assign rewards to specific outcomes (e.g., a function that rewards the answer '4' when asked 'What is 2 + 2?').
  10. Reinforcement Learning (RL) capabilities in Unsloth

    main

    Unsloth provides efficient Reinforcement Learning (RL) capabilities to transform standard models into reasoning models.

    Key capabilities include:

    • Reasoning Model Transformation: With 15GB VRAM, you can transform models up to 17B parameters (e.g., Llama 3.1 8B, Phi-4 14B, Mistral 7B, or Qwen2.5 7B) into reasoning models.
    • Vision/Multimodal Support: Unsloth supports RL for Vision/multimodal (VLM) models.
    • Low VRAM Requirements: A minimum of 5GB VRAM is sufficient to train reasoning models for any model with 1.5B parameters or less.

    Important Note: RL is most effective when starting from an already instruction-finetuned model. If the probability of a correct response is always 0, RL will not work because the model cannot find a signal to learn from.

  11. Security features and architecture

    main

    Moltis is designed with a defense-in-depth security model to protect agents that have real permissions (code, files, credentials, and networks). Key security components include:

    • Safer Foundation: Built in Rust for memory safety and a smaller runtime surface.
    • Defense in Depth: Supports passkeys and passwords in the Web UI, sandboxed tool execution, and an encrypted vault with network protections.
    • Safer Access: Designed for local-first deployment and supports Tailscale for private access paths to keep unauthorized users out.
  12. Understand Unsloth Dynamic 2.0 GGUF Quantization

    main

    Unsloth Dynamic 2.0 is a quantization method that allows running and fine-tuning quantized LLMs while preserving high accuracy.

    Key features include:

    • Intelligent Layer Selection: Dynamically adjusts quantization types for every layer based on the specific model architecture.
    • Broad Compatibility: Works on all models, including both MoE (Mixture of Experts) and non-MoE architectures.
    • Custom-Tailored Schemes: Each model (e.g., Gemma 3 vs. Llama 4) uses a unique quantization scheme optimized for its structure.
    • Expanded Formats: Supports Q4_NL, Q5.1, Q5.0, Q4.1, and Q4.0 formats to maximize efficiency on Apple Silicon and ARM devices.
    • Inference Engine Support: The resulting GGUF files can be used with llama.cpp, Ollama, Open WebUI, and other engines.