Baichuan2

From VectorSpaceLab/AREX-Skill · View interactive version

Baichuan2 is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Route Baichuan2 chat inference, deployment/quantization, and fine-tuning workflows.

How to use this skill

Skill file

Baichuan2

Use this repo skill when a task is about Baichuan2 model selection, chat/base inference, local chat demos, OpenAI-compatible serving, quantized deployment, CPU deployment, checkpoint conversion, or supervised fine-tuning.

Baichuan2 is a model-family repository rather than an importable Python package. The operating guidance is therefore organized around public workflows and bundled helpers, not a package module tree.

Start here

  1. If the task may depend on repo freshness, read CODE0.
  2. If the user has not chosen a checkpoint, read CODE0.
  3. Prepare the smallest environment for the requested workflow using CODE0.
  4. Run a no-weight dependency check before loading 7B/13B weights:
python scripts/check_baichuan2_env.py --workflow inference
python scripts/check_baichuan2_env.py --workflow all --require-cuda

Use --workflow inference, deployment, fine-tuning, or all to match the route. These checks do not download model weights.

Route by user request

| User request signals | Read | Why |

| --- | --- | --- |

| model.chat, Python inference, Base-model generation, terminal demo, Streamlit web UI, OpenAI-compatible /v1/chat/completions | CODE2 | Owns Baichuan2 Chat/Base inference, CLI/web demos, and the Flask chat-completions helper. |

| 4-bit/8-bit quantization, BitsAndBytes, CPU-only loading, load_in_8bit, quantize(4), lm_head.weight, Baichuan1 optimization migration | CODE3 | Owns memory-reduction, CPU deployment, and checkpoint-conversion workflows. |

| supervised fine-tuning, DeepSpeed, LoRA, fine-tune.py, hostfile, W_pack, ds_config, training data schema | CODE3 | Owns SFT data validation, ZeRO-3 launch planning, LoRA, and post-training loading. |

| installation/import/backend failure before a route is clear | CODE0 | Covers shared CUDA, dependency, model-access, and optional-extra problems. |

| license, commercial-use constraints, or citation | CODE0 | Distills the repo's license/citation section. |

Core operating facts

Do not do this

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.