Red-candle is a Ruby gem that provides bindings to the Hugging Face Candle library, enabling Ruby developers to run state-of-the-art language models directly in Ruby without Python or external APIs. The system supports LLMs (Mistral, Llama, Gemma, etc.), embedding models, rerankers, NER models, and vision-language models with hardware acceleration via Metal (Apple GPU) and CUDA (NVIDIA GPU). The architecture features a clean separation between Ruby interface layer and Rust extension. The Ruby layer provides idiomatic APIs (Candle::LLM, Candle::EmbeddingModel, etc.) while the Rust extension handles model loading, tensor operations, and hardware-specific computations using the Candle ML library. Key design patterns include unified model loading via `from_pretrained`, device abstraction for CPU/GPU selection, tokenizer access across all models, structured generation with JSON schema constraints, and a complete tool calling framework with agent capabilities. The project demonstrates strong engineering practices with comprehensive test coverage, extensive examples showing real-world usage (biomedical NER, chat interfaces, reranker benchmarks), and clear documentation. It successfully bridges the Ruby and Rust ecosystems while maintaining performance and usability, making advanced AI accessible to Ruby developers through a consistent, well-abstracted interface.
NovelForge is an AI-assisted long-form novel writing desktop application built with Electron, Vue 3, and FastAPI. It provides a card-based content management system where each story element (characters, scenes, chapters, items, concepts) is stored as typed cards with JSON Schema validation. The core differentiator is a custom workflow engine that uses a code-style DSL with marker comments (`#@node`) to define automation flows, supporting triggers, async execution, pause/resume, and streaming SSE progress. AI integration is deep: configurable LLM providers (OpenAI, Google, Anthropic, Qwen), structured generation via instruction streams (LLM outputs JSON instructions that the frontend executes incrementally), memory extraction from text into cards and a knowledge graph (dual backend: SQLModel or Neo4j), and a context assembly system with a rich template language. The frontend features a dynamic form renderer from JSON Schema, an inspiration assistant with tool-calling agents, a workflow agent that can autonomously edit workflow code via patches, and a chapter editor with AI continuation, polish, and review. The system is designed for professional novelists and supports full project lifecycles from tags and outlines to chapter drafts and quality reviews. The architecture is a typical two-tier application: the backend exposes RESTful APIs and SSE streams; the frontend is a single-page Vue 3 app bundled as an Electron desktop application (with web compatibility via mock). Notable engineering strengths include the workflow node registration pattern, the expression evaluator with safe eval, the memory extractor registry, and the dynamic form systemβall of which are cleanly abstracted and potentially reusable across projects. The codebase is actively maintained, with regular commits, well-organized modules, and comprehensive bootstrap initialization for built-in prompts and card types. However, some features are experimental (workflow agent auto-patching), the custom DSL is format-sensitive, and the heavy reliance on LangChain may introduce version lock-in.