SuperAPIAI Directory

MOSS

github.com · AI assistants

Direct

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

Purpose: MOSS is an open-source language model project from the OpenMOSS team at Fudan University that supports Chinese-English bilingual dialogue and tool calling. The repository provides the MOSS-003 series models, dialogue data, and deployment inference and fine-tuning code, intended for local or remote deployment, dialogue interaction, plugin invocation, SFT fine-tuning, and research and development. Project address:https://github.com/OpenMOSS/MOSS。

Main capabilities: The moss-moon series consists of 16-billion-parameter models. The base was pretrained on approximately 700 billion Chinese, English, and code words, and then underwent dialogue instruction fine-tuning, plugin-enhanced learning, and human preference training. moss-moon-003-sft has instruction-following, multi-turn dialogue, and harmful-request avoidance capabilities; moss-moon-003-sft-plugin, on this basis, supports four types of plugins: search engine, text-to-image, calculator, and equation solving. The INT4 quantized version requires about 12GB of GPU memory and the INT8 quantized version about 24GB for inference. FP16 precision can run on a single A100/A800 or two 3090s, and INT4/8 can run on a single 3090. The README also lists moss-moon-003-pm, moss-moon-003, and moss-moon-003-plugin, noting that they will be open-sourced soon.

Models and Data: The repository provides moss-moon-003-base, moss-moon-003-sft, moss-moon-003-sft-plugin, and their int4/int8 quantized versions. The data includes moss-002-sft-data (approximately 570,000 English and 590,000 Chinese multi-turn dialogues, generated by text-davinci-003, covering helpfulness, faithfulness, and harmlessness), moss-003-sft-data (constructed based on approximately 100,000 user inputs from the MOSS-002 beta test and gpt-3.5-turbo, approximately 1.1 million entries, fully open-sourced), moss-003-sft-plugin-data (approximately 300,000 plugin-enhanced multi-turn dialogues, open-sourced), and moss-003-pm-data (approximately 180,000 additional dialogue contexts and preference comparison data, to be open-sourced soon).

Usage: Download the repository to a local or remote server. It is not recommended to use torch and transformers versions lower than the recommended versions; triton currently supports only Linux and WSL, and does not support Windows or Mac OS. When batch size=1, you can select a model according to the GPU memory table; quantized models do not currently support model parallelism. The repository provides a simple invocation example for moss-moon-003-sft, which can run on a single A100/A800 or CPU, with FP16 occupying about 30GB of GPU memory, and can also run on two NRunning on VIDIA 3090. Quantized inference uses the GPTQ algorithm and the OpenAI triton backend of GPTQ-for-LLaMa; currently only Linux is supported, and quantized models can only be deployed on a single GPU.

Plugin usage: When using moss-moon-003-sft-plugin or its quantized version, the single-turn input and output include fields such as Human and Results; each turn requires two model calls. The first generates up to <eoc> to obtain the plugin call result and writes it to Results, and the second generates up to <eom> to obtain the reply. Use meta instruction to control whether plugins are enabled; by default all plugins are disabled, and when enabled change to enabled and provide the interface format. For the search engine plugin, refer to MOSS WebSearchTool; for other plugin formats, refer to conversation_with_plugins.

Demo and interfaces: You can run moss_web_demo_streamlit.py to open the Streamlit web Demo; by default it runs on a single GPU with moss-moon-003-sft-int4, and you can also specify other models and multi-GPU parallelism; when using the Streamlit command, you need to use an extra -- to separate parameters. The repository also provides moss_web_demo_gradio.py based on Gradio, moss_api_demo.py that provides a simple API service externally (the first call returns a uid, and you can subsequently fill in the uid for multi-turn conversations), the command-line Demo moss_cli_demo.py (enter clear to clear history, enter stop to terminate), and moss_cli_demo_jittor.py supported by Jittor, which can reduce GPU memory consumption through memory swapping when GPU memory is insufficient; Jittor and cupy need to be installed before use.

Deployment and fine-tuning: Engineering solutions include MOSS Vortex (deployment and inference), MOSS WebSearchTool (search engine plugin deployment), MOSS Frontend (MOSS-003 frontend based on Flutter), and MOSS Backend (MOSS-003 backend based on Go). The fine-tuning code is finetune_moss.py; the example uses conversation data without plugins conversation data as an example; the dataset needs to be processed according to the conversation_without_plugins format and placed in the sft_data directory, download the configs folder and adjust it according to the official accelerate documentation, and create run.sh to run; multi-node running requires running once on each machine and correctly specifying machine_rank. If loading the model locally, you can change OpenMOSS-Team/moss-moon-003-base in run.sh to the local model path. When using the tokenizer of moss-moon-003-base, the eos token is <|endoftext|>; training an SFT model requires specifying this token as <eom>.

API service: If you do not have the conditions for local deployment or wish to quickly deploy to a service environment, you can contact the project team to obtain the inference service IP address and a dedicated API KEY; for the interface format, refer to the repository description. Due to limited service capacity, API services are currently only open to enterprises; you need to sign the specified document and fill out the questionnaire to obtain authorization.

Applicable scenarios: Suitable for locally or remotely deployed Chinese-English bilingual multi-turn conversations, dialogue applications with search engine/text-to-image/calculator/equation-solving plugins, model fine-tuning and dialogue data research, web/command-line/API demonstrations and integration, and service environment deployment after enterprises apply for API services.

Limitations and authorization: Due to the relatively small number of model parameters and the autoregressive generation paradigm, MOSS may still generate misleading replies containing factual errors or harmful content containing bias/discrimination; please identify and use them with caution, do not spread harmful content, and the disseminator bears the adverse consequences. The project code uses the Apache 2.0 license, the data uses the CC BY-NC 4.0 license, and the model weights use the GNU AGPL 3.0 license. If you need to use the model for commercial purposes or public deployment, you need to sign the specified document and fill out the questionnaire to obtain authorization; commercial use is only for recording and no fees will be charged. The README also states that MOSS-003 is still a very early model, and future plans include strengthening logical reasoning, safety and trustworthiness, multimodal foundation models, and personalized artificial intelligence.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools