diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index bc65d74..019c94c 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -18,9 +18,9 @@ jobs: fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@v3 with: - hugo-version: '0.106.0' + hugo-version: '0.155.3' # Set a Hugo version to build your site extended: true - name: Build diff --git a/config.yml b/config.yml index 214e6fd..a096958 100644 --- a/config.yml +++ b/config.yml @@ -1,6 +1,7 @@ baseURL: "https://inclusionai.github.io/" title: INCLUSION AI -paginate: 5 +pagination: + pagerSize: 5 theme: PaperMod enableRobotsTXT: true diff --git a/content/blog/using-ring-1t-with-claude-code-via-zenmux/index.md b/content/blog/using-ring-1t-with-claude-code-via-zenmux/index.md new file mode 100644 index 0000000..beeaa18 --- /dev/null +++ b/content/blog/using-ring-1t-with-claude-code-via-zenmux/index.md @@ -0,0 +1,842 @@ +--- +title: "Using Ring 1T with Claude Code via ZenMux" +date: 2026-02-15T00:00:03+08:00 +weight: 1 +math: true +# search_hidden: false # to hide from search page +show_reading_time: true +show_bread_crumbs: true +show_post_nav_links: false # the prev/next after the content +show_code_copy_buttons: true +show_word_count: true +--- + +# Using Ring 1T with Claude Code via ZenMux + +## What is Ring 1T? + +Ring 1T is a powerful open-source reasoning model designed for complex problem-solving and advanced coding tasks. It's built on the Ling 2.0 architecture with impressive capabilities: + +- **Scale**: 1 trillion total parameters with 50 billion activated parameters +- **Context**: Supports up to 128K tokens context window +- **Training**: Enhanced through large-scale verifiable reward reinforcement learning (RLVR) +- **Strengths**: Excels at deep reasoning, natural language inference, and sophisticated code generation + +Ring 1T represents the latest advancement in MoE (Mixture of Experts) architecture scaling, leveraging the icepop reinforcement learning stabilization method and the ASystem framework to deliver exceptional reasoning performance. + +**Open Source**: Download model weights from [Hugging Face](https://huggingface.co/inclusionAI/Ring-1T), [ModelScope](https://modelscope.cn/models/inclusionAI/Ring-1T), and [ZenMux](https://zenmux.ai/inclusionai/ring-1t). + +## What is ZenMux? + +ZenMux is an enterprise-grade AI model aggregation platform that provides unified access to leading language models worldwide. Key features include: + +- **Unified API**: Access models from OpenAI, Anthropic, Google, DeepSeek, and more through a single interface +- **Intelligent Routing**: Automatically select optimal models based on your needs +- **High Availability**: Built-in failover mechanisms ensure reliability +- **Quality Assurance**: AI model insurance services (coming soon) to address concerns about hallucinations and output instability + +With ZenMux, developers can seamlessly integrate multiple AI models without managing different APIs or endpoints. + +## What is Claude Code? + +Claude Code is Anthropic's official AI coding agent that helps you write, debug, and understand code directly from your terminal or VSCode. It combines: + +- **Natural conversation**: Interact with AI using natural language +- **Code awareness**: Understands your project structure and context +- **Direct execution**: Reads files, makes edits, and runs commands +- **Flexibility**: Works as both a CLI tool and VSCode extension + +Claude Code is designed to be your AI pair programmer, handling everything from simple code questions to complex multi-file refactoring. + +## Why Ring 1T with Claude Code via ZenMux? + +Combining these three tools gives you: + +- **Ring 1T's advanced reasoning** for complex coding challenges +- **Claude Code's intuitive interface** for seamless interaction +- **ZenMux's unified platform** for easy model access and management + +This guide walks you through configuring Claude Code to use Ring 1T through ZenMux—it takes just a few environment variables. The key setting is: `ANTHROPIC_BASE_URL="https://zenmux.ai/api/anthropic"` + +## Getting Started: Installation & Configuration + +### Step 1: Install Claude Code + +**Important Update: npm/pnpm Installation Is Deprecated** + +The npm/pnpm installation method for Claude Code has been deprecated. If you previously installed via npm/pnpm, first uninstall the old version: + +```bash +npm uninstall -g @anthropic-ai/claude-code +# or +pnpm uninstall -g @anthropic-ai/claude-code +``` + +Then use the new native installation method. + +**Recommended: Native Installation** + +**macOS/Linux/WSL:** +```bash +curl -fsSL https://claude.ai/install.sh | bash +``` + +**Windows PowerShell:** +```powershell +irm https://claude.ai/install.ps1 | iex +``` + +**Windows CMD:** +```batch +curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd +``` + +**Package Managers (manual updates required):** + +Homebrew (macOS): +```bash +brew install --cask claude-code +``` + +WinGet (Windows): +```powershell +winget install Anthropic.ClaudeCode +``` + +**Installation Notes** +- Native installers auto-update automatically +- Package manager installs require manual updates via `brew upgrade claude-code` or `winget upgrade Anthropic.ClaudeCode` +- After installation, verify with: `claude doctor` +- For full details, see [Claude Code installation docs](https://code.claude.com/docs/en/setup) + +### Configure Claude Code + +#### How the Configuration Works + +By default, Claude Code connects to Anthropic's service. To use Ring 1T, we redirect requests to ZenMux using environment variables. This approach: + +- **Requires no changes to Claude Code**: Just set environment variables +- **Uses your ZenMux API Key**: Simple authentication +- **Enables Ring 1T access**: Use the powerful reasoning model in Claude Code + +The setup involves two key environment variables: `ANTHROPIC_BASE_URL` (ZenMux endpoint) and `ANTHROPIC_AUTH_TOKEN` (your ZenMux API Key). This routes all Claude Code requests through ZenMux to Ring 1T. + +> **Important Change in v2.0.7x** +> +> Due to updates in Claude Code v2.0.7x, its **environment-variable loading logic has changed**: the `env` config in `~/.claude/settings.json` **cannot be reliably read** in the following scenarios: +> +> - When **logging in for the first time** in Claude Code +> - When logging in again after running **logout** +> +> Therefore, when connecting to ZenMux, it’s recommended to standardize on **shell profile environment variables** to ensure both login and requests go through ZenMux’s Anthropic-compatible endpoint. + +### Step 2: Get a ZenMux API Key + +Before configuring Claude Code, obtain a ZenMux API Key. ZenMux offers two billing options: + +```text [Subscription API Key (Recommended)] +Best for: Personal development, learning/exploration, Vibe Coding +Features: Fixed monthly fee, predictable cost, 5–10x price advantage +API Key format: `sk-ss-v1-xxx` + +Getting started: +1. Visit the [subscription management page](https://zenmux.ai/platform/subscription) +2. Choose a plan (Pro $20/mo, Max $100/mo, Ultra $200/mo) +3. Create a subscription API Key after subscribing + +For more details, see the [Subscription Plan Guide](https://docs.zenmux.ai/guide/subscription) +``` + +```text [Pay-as-you-go API Key] +Best for: Production, commercial products, enterprise applications +Features: No rate limits, production-grade stability, pay-per-use billing +API Key format: `sk-ai-v1-xxx` + +Getting started: +1. Visit the [pay-as-you-go page](https://zenmux.ai/platform/pay-as-you-go) +2. Top up your account (includes 20% bonus credit automatically) +3. Create an API Key in the "Pay-as-you-go API Keys" section + +For more details, see the [Pay-as-you-go Guide](https://docs.zenmux.ai/guide/pay-as-you-go) +``` + +> **Important: Choose the Right API Key Type** +> +> - **For personal development or learning** → Use a **Subscription API Key** (`sk-ss-v1-xxx`) for better value and lower cost +> - **For production or commercial projects** → Use a **Pay-as-you-go API Key** (`sk-ai-v1-xxx`) for higher stability and no limits +> +> Note: Subscription keys are not allowed for production use. Using them incorrectly may result in account restrictions. + +### Step 3: Configure Claude Code + +#### How the Configuration Works + +By default, Claude Code connects to Anthropic's official service. To use Ring 1T via ZenMux, redirect requests using environment variables: + +- **No changes needed to Claude Code itself** — just set two environment variables +- **Simple authentication** — use your ZenMux API Key +- **Transparent redirection** — all requests route through ZenMux to Ring 1T + +The configuration uses two key variables: +- `ANTHROPIC_BASE_URL` — points to ZenMux's Anthropic-compatible endpoint +- `ANTHROPIC_AUTH_TOKEN` — your ZenMux API Key for authentication + +> **Important: Claude Code v2.0.7x Environment Variable Loading** +> +> In Claude Code v2.0.7x and later, environment variables in `~/.claude/settings.json` **cannot be reliably loaded** during: +> - First-time login +> - Login after running `logout` +> +> **Recommendation**: Use **shell profile environment variables** (as shown below) to ensure consistent availability during both login and API requests through ZenMux. + +#### Option 1: Shell Profile Configuration (Recommended) + +```bash +# 1. Determine which shell you are using (usually bash or zsh): +# - If using bash, edit ~/.bashrc +# - If using zsh, edit ~/.zshrc +# - If you're not sure, run echo $SHELL + +# 2. Append the following to the end of the corresponding config file (replace the API Key) + +# ============= ZenMux + Claude Code Configuration ============= +# Connect Claude Code to ZenMux instead of Anthropic’s official service + +# Core settings: ZenMux endpoint and authentication +export ANTHROPIC_BASE_URL="https://zenmux.ai/api/anthropic" # ZenMux Anthropic-compatible endpoint +export ANTHROPIC_AUTH_TOKEN="sk-ss-v1-xxx" # Replace with your ZenMux API Key (subscription sk-ss-v1-xxx or pay-as-you-go sk-ai-v1-xxx) +export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1" # Disable non-essential traffic +export API_TIMEOUT_MS="30000000" # API timeout in milliseconds + +# Avoid conflicts: if you previously set ANTHROPIC_API_KEY locally, explicitly clear it +export ANTHROPIC_API_KEY="" + +# Model configuration: Set Ring 1T as your default model +# Ring 1T excels at reasoning and complex coding tasks +export ANTHROPIC_DEFAULT_HAIKU_MODEL="inclusionai/ring-1t" # Fast tier +export ANTHROPIC_DEFAULT_SONNET_MODEL="inclusionai/ring-1t" # Balanced tier (recommended) +export ANTHROPIC_DEFAULT_OPUS_MODEL="inclusionai/ring-1t" # Most capable tier + +# 3. Apply the configuration (choose one): +# Option 1: Reload the config file (recommended) +source ~/.bashrc # if using bash +# or +source ~/.zshrc # if using zsh + +# Option 2: Restart the terminal window +``` + +On Windows, the process is similar but uses PowerShell and the PowerShell Profile: + +```powershell [Windows PowerShell] +# ============== Steps ============== + +# On Windows, use the PowerShell Profile to configure environment variables +# PowerShell 7+ is recommended for a better experience + +# 1. Check whether the PowerShell Profile exists +Test-Path $PROFILE + +# 2. If it returns False, create the Profile file +if (!(Test-Path $PROFILE)) { + New-Item -Path $PROFILE -ItemType File -Force +} + +# 3. Open the Profile file for editing +notepad $PROFILE +# If you use VSCode, you can also run: code $PROFILE + +# 4. Append the following to the end of the Profile file (replace the API Key) + +# ============= ZenMux + Claude Code Configuration ============= +# Connect Claude Code to ZenMux instead of Anthropic’s official service + +# Core settings: ZenMux endpoint and authentication +$env:ANTHROPIC_BASE_URL = "https://zenmux.ai/api/anthropic" # ZenMux Anthropic-compatible endpoint +$env:ANTHROPIC_AUTH_TOKEN = "sk-ss-v1-xxx" # Replace with your ZenMux API Key (subscription sk-ss-v1-xxx or pay-as-you-go sk-ai-v1-xxx) +$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1" # Disable non-essential traffic +$env:API_TIMEOUT_MS = "30000000" # API timeout in milliseconds + +# Avoid conflicts: if you previously set ANTHROPIC_API_KEY locally, explicitly clear it +$env:ANTHROPIC_API_KEY = "" + + +# Model configuration: Set Ring 1T as your default model +# Ring 1T excels at reasoning and complex coding tasks +# https://zenmux.ai/inclusionAI/ring-1t +$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "inclusionai/ring-1t" # Fast tier +$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "inclusionai/ring-1t" # Balanced tier (recommended) +$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "inclusionai/ring-1t" # Most capable tier + +# 5. Save the file, then restart PowerShell to apply +# Or run this in the current window: . $PROFILE + +# 6. Verify the environment variables were set successfully +Write-Host "ANTHROPIC_BASE_URL: $env:ANTHROPIC_BASE_URL" +Write-Host "ANTHROPIC_AUTH_TOKEN: $env:ANTHROPIC_AUTH_TOKEN" +``` + +> **Important: Replace the API Key** +> +> Be sure to replace `sk-ss-v1-xxx` or `sk-ai-v1-xxx` in the configuration with your real ZenMux API Key: +> +> **Subscription API Key (recommended for personal development)** +> +> - Format: `sk-ss-v1-xxx` +> - Get it from: [Subscription management page](https://zenmux.ai/platform/subscription) +> - Detailed guide: [Subscription plan docs](/guide/subscription) +> +> **Pay-as-you-go API Key (production)** +> +> - Format: `sk-ai-v1-xxx` +> - Get it from: [Pay-as-you-go page](https://zenmux.ai/platform/pay-as-you-go) +> - Detailed guide: [Pay-as-you-go docs](/guide/pay-as-you-go) + +### Environment Variable Reference + +| Variable | Purpose | Notes | +| ---------------------- | ---------------- | --------------------------------------------------- | +| `ANTHROPIC_BASE_URL` | Service endpoint | Redirects Claude Code requests to ZenMux | +| `ANTHROPIC_AUTH_TOKEN` | Auth token | Your ZenMux API Key (subscription or pay-as-you-go) | + +### Step 4: Launch Claude Code + +Open a new terminal window to load the environment variables, then start Claude Code: + +1. Go to your project directory: + + ```bash + cd /path/to/your/project + ``` + +2. Start Claude Code: + + ```bash + claude + ``` + +3. On first launch, Claude Code will automatically: + - Read `ANTHROPIC_AUTH_TOKEN` from your environment variables + - Authenticate through the ZenMux Anthropic-compatible endpoint + - Begin working immediately\u2014no additional login needed + +**If you encounter issues:** + +- The `claude` command not found \u2192 Verify Claude Code is installed globally (see the installation steps above) + +### Step 5: Verify the Connection + +After launching successfully, run `/status` in Claude Code to verify the connection. The output should display: + +```text +Auth token: ANTHROPIC_AUTH_TOKEN +Anthropic base URL: https://zenmux.ai/api/anthropic +``` + +**What to check:** + +- `Auth token` displays `ANTHROPIC_AUTH_TOKEN` (loaded from environment variables) +- `Anthropic base URL` displays `https://zenmux.ai/api/anthropic` (the ZenMux endpoint) + +If the configuration is correct, your setup is complete—start leveraging Ring 1T's reasoning capabilities in Claude Code. + +## Using Claude Code: CLI vs VSCode Extension + +You can use Claude Code in two ways. Choose based on your preferences: + +### CLI (Command-Line) - Recommended + +**When to use**: You prefer command-line tools, want automatic environment variable loading, or need to work across multiple projects. + +The CLI automatically loads environment variables from your shell profile (Steps 1-5 above): + +```bash +cd /path/to/your/project +claude +``` + +**Advantages:** +- Environment variables load automatically from shell profile +- No additional configuration needed in VSCode +- Works consistently across all projects in that shell +- Lightweight and straightforward + +### VSCode Extension + +**When to use**: You prefer an integrated development environment, want settings isolated to VSCode, or use VSCode as your primary editor. + +Configure Claude Code directly in VSCode settings: + +#### Step 1: Install the Extension + +Search for "Claude Code" in the VSCode Extensions marketplace and install it. Once installed, the Claude Code icon will appear in your sidebar. + +
+
+
+
+