↓Skip to main content
  1. Posts/

Testing and Running China’s Open-Weight AI Models: Faster, Cheaper, But Good Enough?

·4 mins

China’s open-weight AI models are creeping up fast. According to the latest Mozilla AI report, the best open Chinese models are now only 4 months behind bleeding-edge US competitors like OpenAI’s GPT-4 Turbo or Anthropic’s Claude 3. They still trail in some benchmarks (especially on nuanced reasoning tasks), but they come with one very interesting promise: drastically lower costs.

This post walks you through how to install, test, and compare one such model. We’ll focus on Baichuan 13B, a solid mid-weight contender. By the end, you’ll know if trading raw edge for affordability and open-source vibes is worth your time.


Why Baichuan 13B? #

If you’re on r/LocalLLaMA, you’ve already seen Baichuan 13B mentioned repeatedly since it dropped. It’s an open-weight model, meaning you can download and run it locally without Elon or Sam Altman peering over your shoulder. Like LLaMA 2 13B, it targets the middle of the stack: not tiny like Mistral 7B, but not GPU-hungry like a full-scale GPT-4 competitor.

Stats:

  • Parameters: 13 billion
  • RAM Usage: About 26 GB in FP16 or 13 GB with 4-bit quantization (more on this below).
  • Speed: It hits 9-10 tokens/sec on a 16GB RTX 3080 with 4-bit quantization.
  • Performance: Falls slightly behind OpenAI’s GPT-3.5 Turbo on ARC benchmarks, but leads older open models like GPT-J.

And here’s the kicker: it’s free to use, assuming you have enough local hardware. Cloud inference (e.g., via CoreWeave) costs pennies compared to OpenAI APIs.


Step 1: Hardware Setup #

First, make sure your system can handle it. For local runs:

  • GPU: 16GB VRAM for FP16 or 12GB in 4-bit. (RTX 3060 or better.)
  • RAM: At least 32GB system RAM.
  • Disk Space: You’ll need 20-25GB free for the weights, depending on the quantization level.

No GPU? You can technically run it on CPU with GGML, but expect to wait 3-5 seconds per token unless you like coffee breaks between prompts. Alternatively, spin something up on RunPod or Paperspace if cloud is your jam — just check the hourly GPU rates.


Step 2: Install the Model #

We’re going GPTQ here for 4-bit quantization — it’s the sweet spot for inference speed and memory efficiency.

  1. Install dependencies:

    python3 -m pip install torch torchvision transformers optimum
    git clone https://github.com/qwopqwop200/GPTQ-for-LLaMa.git
    cd GPTQ-for-LLaMa
    python setup.py install
    
  2. Download weights (Baichuan):
    Head to Hugging Face and download the appropriate quantized checkpoints. Look for something like baichuan-13b-GPTQ-4bit-128g.

  3. Move weights into place:
    Extract the model to a specific directory, e.g., ./models/baichuan_13b/.

  4. Test the model:
    Use text-generation-webui for an easy UI. Clone and install it:

    git clone https://github.com/oobabooga/text-generation-webui.git
    cd text-generation-webui
    pip install -r requirements.txt
    

    Launch the interface:

    python server.py --model ./models/baichuan_13b/
    

    Open your browser at http://localhost:7860 to interact. Try a few prompts like:

    "Write a 100-word story about an AI that solves crimes."
    

Typical Performance and Outputs #

Let’s get real for a second. The community benchmarks show Baichuan 13B running about 10%-20% slower than LLaMA 2 on standard hardware (see this r/LocalLLaMA thread for real-user feedback). Quality-wise, it’s perfectly fine for day-to-day tasks like code suggestions, summarization, or creative writing. But it’s noticeably weaker than GPT-4 for logic-heavy tasks like solving SAT questions or providing nuanced legal advice.

Example outputs:

Prompt: “Explain the difference between JSON and YAML.” #

Baichuan 13B:
“JSON and YAML are data serialization formats. JSON is stricter and uses a compact syntax, while YAML is more human-readable and accommodates comments.”

As you’d expect: concise but doesn’t blow you away. GPT-4, in comparison, would probably cover edge cases and trade-offs in more depth.


Step 3: Scaling Economically #

Running all this locally works great if you’ve got hardware lying around. But let’s talk cloud. For inference benchmarks:

  • Hetzner’s GPU offerings: Around $0.60/hour for a 20GB GPU instance — way cheaper than AWS pricing.
  • RunPod: Competitive for smaller instances. You can host an RTX 3090 setup for $0.35/hour. Good enough for experiments.

Real World Math: If running GPT-4 Turbo in production costs ~4x more than Baichuan on Hetzner, then Baichuan starts looking very attractive for apps scaling at or below 20 req/min.


Where Baichuan Falls Short #

  1. Benchmarks Matter: Gap widens on advanced tasks. If you’re building anything where reasoning precision is critical (think medical diagnostics), Baichuan’s not there yet.
  2. Community Tools: Less polish than US-adjacent LLaMA ecosystem. Expect minor roadblocks when packaging or fine-tuning.
  3. License Uncertainty: Baichuan is technically open-weight, but its licensing doesn’t explicitly cover heavy commercial use. Know the risks.

FAQ #

How does Baichuan 13B compare to LLaMA 2 13B? #

Baichuan is slightly weaker on some benchmarks (HellaSwag, ARC), but it performs similarly on casual language tasks. With fewer ecosystem restrictions, Baichuan makes a compelling alternative where licensing or costs are concerns.

Can it run on my RTX 2060? #

Yes, but you’ll need 4-bit quantization and aggressive memory management. Expect slower token speeds (~2-3 tokens/sec).

Is quantizing the model worth it? #

For 90% of users, yes. Quantization gives you near-engineered throughput improvements without nuking accuracy for casual tasks.


That’s the lowdown. If you’re fine with “good enough” and enjoy keeping Big Tech at arm’s length, China’s offerings — including Baichuan 13B — are well worth a spin. Just don’t expect GPT-4 magic for now.