DEV Community

Alex
Alex

Posted on

Moly: An Open-Source LLM Client Implemented in Pure Rust

Moly is an AI LLM client written in Rust. As a flagship application project of Robius, it demonstrates the powerful development capabilities of Makepad UI and Robius.
Currently, Moly supports Mac/Linux/Windows platforms, and will support iOS and Android mobile platforms in the near future.
You can follow the instructions at https://github.com/moxin-org/moly to install and use Moly.

Introduction to Moly's Basic Features

Discovering Models

Image description

The initial interface displays a list of locally supported Featured Agents and Models. Note that if your version doesn't support Agents yet, you won't see Featured Agents content.
You can choose to download the open-source model that suits your machine configuration. Click the arrow in the bottom right corner of the window to expand and view the current model's download status. You can also pause or delete models that are being downloaded.

Image description

When you scroll down the window page, a Sort By dropdown list will appear in the top right corner of the window. You can sort the model list according to your needs.

Image description

You can also directly search for the model you want through the search bar at the top of the window.

Image description

Managing Downloaded Models

You can click the My Models Tab in the left operation bar to manage your downloaded models.

Image description

Click the 'i' icon in each row of the model list to view detailed information about the model.

Image description

Click 'Show in Finder' to view the model download directory.

Image description

Click 'Change Download location' to modify the download directory path.

Image description

Chatting with AI

Click the Chat Tab in the sidebar to bring up the chat window. Click the arrow button at the top of the window to select your currently downloaded large model.
Of course, you can also open this window by clicking the 'Chat with Model' button in the local large model list managed in the My Models Tab.

Image description

In the chat input box at the bottom of the window, you can directly ask questions to your chosen large model.
You can also use the '@' operation to bring up a selection box to choose the large model or Agent you want to converse with.

Image description

Then you can have a conversation with it.

Image description

Click the collapse icon in the top left corner of the window to hide the 'CHATS' chat window list on the left. Click again to expand it.

Image description

Similarly, clicking the arrow collapse button in the top right corner of the window will bring up the 'Chat Setting' window, where you can configure the large model's System Prompt and parameters according to your needs.

Image description

System Configuration

Click the 'Setting' button in the bottom left corner of the sidebar to open Moly's system configuration window.

Image description

Currently, you can modify the backend large model service port. You can also add a new MoFA Agent service.

Image description

How Moly Drives Makepad's Evolution

As Robius's flagship application, Moly's role is also to promote the evolution of the Makepad UI framework. Let's use the evolution of two Makepad basic Widgets as examples to illustrate.

Modal Widget

Earliest discussions (early October):

  1. Jmbejar proposed a new Modal design approach - "Modal deref" mode, inspired by practical experience from the Moly project. The main advantages are:
    • Modal content can be implemented as an independent widget rather than as a Modal child component
    • Simplifies how developers implement complex modal content without needing to consider parent-child component communication
    • Follows the deref pattern commonly used in makepad View widget
  2. Kevin raised some considerations about this design:
    • The current Modal design only requires developers to correctly handle dismissed action
    • The new design requires developers to implement more interfaces (open, close, capture actions, etc.)
    • Need to balance whether it increases the burden on novice developers

Problem evolution (mid-October to November):

  1. Some visual issues were discovered in actual use:
    • Modal background content "leakage"
    • Random text highlighting
    • Issues particularly when using Modal + Dock combination

Latest improvement direction (mid-November):

  1. Julian proposed the draw_depth propagation solution:
    • Pass draw_depth to child components through Scope
    • Child components use larger draw_depth values when drawing
    • This approach may solve visual overlay issues

In summary, Moly project's improvements to Makepad Modal widget are mainly reflected in:

  1. Architecture design level: Provided the "Modal deref" design approach, making component structure clearer
  2. Practical verification: Discovered and solved problems in actual applications through use in Moly
  3. Development experience: Promoted discussion of developer friendliness, balancing flexibility and ease of use

This case demonstrates how Moly, as a Makepad practical project, drove improvements and evolution of the underlying widget system.

Sliding Panels Widget

Initial state and requirements of the sliding panels component:

Makepad already had a basic ExpandablePanel component (widgets/expandable_panel.rs), which was actually used in the Wonderous project's timeline_screen.rs. This laid the foundation for subsequent sliding panel development.

A key turning point in evolution emerged when developers proposed a new use case: Kevin wanted to implement an overlay panel that slides in from the right side to display user profile information. This requirement had several important characteristics:

  1. The panel needs to be presented as an overlay layer
  2. Sliding in should not change the size of the main content area
  3. This functionality needs to combine features from Moly project's FadeView and Modal

This requirement prompted the development team to rethink the sliding panel design.

It's particularly noteworthy that this evolution process was significantly influenced by the Moly project. Moly's FadeView and Modal components provided important reference implementations for Makepad, demonstrating how to combine animation effects and overlay layers. This again shows how Moly, as a practical project, drives the advancement of the Makepad widget system.

Overall, the evolution of sliding panels reflects the maturation process of the Makepad UI framework driven by practical applications - developing from basic functional components into a complete, unified interaction design language. In this process, the Moly project played a crucial catalytic role, guiding Makepad's development direction through providing practical experience and mature implementations.

Future Development

Moly has currently added Agent support in the dev branch. This Agent capability is obtained through integration with MoFA.
If you're interested, you can follow the configuration described here to run Moly and MoFA to try the Agent features shown earlier.
Moly will add more Agent tools through MoFA in the future.
Additionally, Moly is considering deep integration with Moxin LLM. Moxin LLM is a truly open-source large model that fully complies with the Model Openness Framework (MOF).
Finally, Moly will also support iOS and Android mobile platforms.

Top comments (0)