CodeGeeX4

Stale
GitHub Python Apache-2.0

Description

Zhipu open-source multi-scenario code LLM supporting completion, explanation, retrieval, and function calling.

Key Features

  • All-in-one model — single model handles completion, explanation, translation, retrieval, and function calling
  • Multi-language — covers 20+ languages including Python, Java, Go, JavaScript, and C++
  • Repository-level Q&A — understands whole-repo context to answer cross-file questions
  • Function calling — built-in tool-use hooks for retrieval, execution, and external services
  • Efficient 9B parameters — CodeGeeX4-ALL-9B balances quality with on-device deployment cost
  • Open weights — Apache-2.0 license, supports commercial use and fine-tuning

Use Cases

💡 IDE code completion and explanation: VS Code and JetBrains plugin-grade experience.
💡 Code review: auto-explain legacy code intent and flag potential issues.
💡 Repository-level Q&A: let the model grasp the whole project to answer architecture and dependency questions.
💡 Automated script generation: combine function calling with RAG to write internal tooling.

Quick Start

# Install
pip install transformers torch accelerate
# Load via transformers
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained('ZhipuAI/codegeex4-all-9b', trust_remote_code=True).cuda()
tok = AutoTokenizer.from_pretrained('ZhipuAI/codegeex4-all-9b', trust_remote_code=True)
out = model.generate(**tok('def fibonacci(n):', return_tensors='pt').to('cuda'), max_length=128)
print(tok.decode(out[0], skip_special_tokens=True))

Related Projects