Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

AIBOX-K3 Claude Code Application Usage

225

Credits

0

Prestige

0

Contribution

super moderator

Rank: 8Rank: 8

Credits
225

AIBOX-K3 Claude Code Application Usage

Posted at 3 day before      View42 | Replies0        Print      Only Author   [Copy Link] 1#
Last edited by 799959745 In 6/3/2026 15:51 Editor

Claude Code (Cloud Compute)
Claude Code is an AI-driven command-line coding tool developed by Anthropic. It provides a terminal interface for interacting with Claude and supports AI-assisted development workflows such as code generation, debugging, refactoring, and technical guidance.
Platform Support
Platform / OSSupport
K1 Buildroot❌ No
K1 OpenHarmony❌ No
K1 Bianbu LXQT/GNOME✅ Yes
K3 Buildroot❌ No
K3 OpenHarmony❌ No
K3 Bianbu LXQT/GNOME✅ Yes
1. Installation
1.1 Install npm
  1. sudo apt install npm
Copy the code

1.2 Install Claude Code
  1. sudo npm i -g @anthropic-ai/claude-code@2.1.112
Copy the code
If access to the default npm registry is restricted, install from a mirror registry instead.
  1. sudo npm i --registry=https://registry.npmmirror.com -g @anthropic-ai/claude-code@2.1.112
Copy the code
Note: Version 2.1.112 is the currently supported release. Do not install a later version.
Verify the installation:
  1. claude --version
Copy the code
If a version number is returned, Claude Code has been installed successfully.
2. Configuration
2.1 Set Environment Variables
After obtaining the provider URL and API key, add them to ~/.bashrc as follows:
  1. cat >> ~/.bashrc << 'EOF'
  2. export ANTHROPIC_BASE_URL="Provider URL"
  3. export ANTHROPIC_AUTH_TOKEN="Generated API key"
  4. EOF
  5. source ~/.bashrc
Copy the code
2.2 Configure Automatic API Key Approval
  1. (cat ~/.claude.json 2>/dev/null || echo 'null') | jq --arg key "${ANTHROPIC_API_KEY: -20}" '(. // {}) | .customApiKeyResponses.approved |= ([.[]?, $key] | unique)' > ~/.claude.json.tmp && mv ~/.claude.json.tmp ~/.claude.json
Copy the code

3. Basic Usage
Start an interactive Claude Code session:
  1. claude
Copy the code
The startup screen appears below.
Example greeting using the Say Hello prompt:
Use /model to switch models.
During an interactive session, Claude Code can help with:
  • Answering programming questions
  • Generating and optimizing code
  • Debugging and refactoring existing code
  • Providing technical recommendations and best practices
Enter /exit to end the session.
4. Example Workflow
This example demonstrates Claude Code generating and debugging an ONNX Runtime image-classification program.
  • Enter the following request:
    1. Write a program that calls ONNX Runtime, downloads and uses the ResNet50 model for image classification, and displays the classification result.
    Copy the code
    Claude Code starts analyzing the request and generating the program.
  • Claude Code completes the implementation and provides the execution steps.
  • Run the program. If an exception occurs, Claude Code analyzes the error and applies a fix.
  • After the fix, the program runs successfully.
  • The program can also be executed manually and produces the expected result.

5. Connecting to On-Device AI: Basic Trial
Claude Code can also connect to a local on-device inference service for basic experimentation. This section is optional and serves as a simple local trial.
5.1 Set Environment Variables
  1. cat >> ~/.bashrc << 'EOF'
  2. export ANTHROPIC_BASE_URL="http://localhost:8080"
  3. export ANTHROPIC_AUTH_TOKEN="llama"
  4. EOF
  5. source ~/.bashrc
Copy the code

5.2 Configure Automatic API Key Approval
  1. (cat ~/.claude.json 2>/dev/null || echo 'null') | jq --arg key "${ANTHROPIC_API_KEY: -20}" '(. // {}) | .customApiKeyResponses.approved |= ([.[]?, $key] | unique)' > ~/.claude.json.tmp && mv ~/.claude.json.tmp ~/.claude.json
Copy the code

5.3 Start llama-server
  1. llama-server -m Qwen2.5-0.5B-Instruct-Q4_0.gguf -t 8 --host 127.0.0.1 --port 8080 --ctx-size 153600 --n-gpu-layers 0 --batch-size 512 --metrics --no-mmap
Copy the code

Note: Claude Code uses a long input context, so --ctx-size must be set high enough. This example uses 153600 because 15360 is not sufficient for this scenario.
5.4 Run Claude Code
Start Claude Code with the local model and run a simple greeting test.
  1. claude --model qwen2.5:0.5b
Copy the code

The initial greeting may take longer because the model prefill can exceed 17,000 tokens.
Subsequent algorithm-generation tasks are noticeably faster, but output quality may still be constrained by the compact local model.


Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list