This guide explains how to install, deploy, and start the MoFA framework built on Dora-RS.
- Clone the project and switch to the specified branch:
git clone <repository-url> && git checkout <branch-name>
Example:
git clone git@github.com:moxin-org/mofa.git && cd mofa
- Use Python 3.10 or later:
- If there's a version mismatch, reinstall the environment using conda. For example:
conda create -n py310 python=3.10.12 -y
- Set up the project environment:
- Install the required dependencies:
cd python && pip3 install -r requirements.txt && pip3 install -e .
Once installed, you can use the command mofa --help
to view CLI help information.
- Install Rust and Dora-RS:
Since the Dora-RS computing framework is built using Rust, visit the following page to install Rust for your operating system:
https://www.rust-lang.org/tools/install
Then, install Dora-CLI:
cargo install dora-cli --locked
In the examples
directory, we provide some available agent examples. Before use, you need to configure the .yml
files in the configs
directory of the agent. If the node
was installed via pip, locate the node's name in the agent-hub
and modify the .yml
file accordingly.
Example of configuring the LLM inference API:
Using OpenAI API:
MODEL:
MODEL_API_KEY:
MODEL_NAME: gpt-4o-mini
MODEL_MAX_TOKENS: 2048
You can also configure it to use the Ollama model or the local open-source model provided by Moxin:
Example using Ollama:
MODEL:
MODEL_API_KEY: ollama
MODEL_NAME: qwen:14b
MODEL_MAX_TOKENS: 2048
MODEL_API_URL: http://192.168.0.1:11434
Example: Starting the hello_world
Agent in the examples
directory:
-
Navigate to the directory:
Open the terminal, switch to the
hello_world
directory, and execute the following command:cd /mofa/python/examples/hello_world
-
Build the Dataflow file:
Open a new terminal window in the current directory and execute the following command to prepare and build the Dataflow:
dora up && dora build dataflow.yml
Here,
dataflow.yml
is the configuration file describing the Agent's execution flow. -
Start the Dataflow process:
In the same terminal, start the Dataflow process:
dora start dataflow.yml
-
Handle dynamic nodes:
If
dataflow.yml
specifies a node'spath
asdynamic
(e.g.,path: dynamic
), you need to run that dynamic node in a separate terminal. Example: The nodeterminal-input
is a dynamic node in the following configuration:nodes: - id: terminal-input build: pip install -e ../../node-hub/terminal-input path: dynamic outputs: - data inputs: agent_response: agent/agent_response
For the above node, open a new terminal and run the following command to start the dynamic node:
terminal-input
This ensures
terminal-input
runs properly and sends/receives data as required.
More detailed documentation is available in the documents subdirectory.