Dongfangzan's Blog and Documentation

website·Indexed 31 days ago

https://www.dongfangzan.cn

A personal knowledge base and blog by programmer Dongfangzan, featuring technical guides on deploying LLMs like DeepSeek-R1 and Mimo-V2-Flash, LangChain development, Tesla API integration, and study materials for the Certified Practising Accountant (CPA) exam.

Tokens
23.4K
Snippets
99
Records
150
Agent score
50%

What's inside Dongfangzan

  1. Overview of the CPA learning guide

    This guide is designed as a supplementary resource for CPA exam preparation. Instead of a traditional textbook approach, it uses a case-based, 'learning by doing' method to explain complex accounting concepts through real-life scenarios, accounting entries, audit working papers, and tax filing examples. It is intended to bridge the gap between abstract academic concepts and practical application.
  2. Overview of the Certified Practising Accountant (CPA) Exam

    The Certified Practising Accountant (CPA) exam is for professionals practicing in accounting firms. Candidates can become non-practicing members by passing the exams, or practicing CPAs by registering with the Institute of Certified Public Accountants after passing.
  3. Introduction to Vibe Coding with Z Code and GLM 4.7

    Vibe Coding is a paradigm shift where developers move from manually writing code to using natural language to describe requirements, allowing AI agents to handle the implementation. Z Code is a GUI-based coding tool that integrates AI agents for planning, coding, reviewing, and deployment, serving as an alternative to command-line interfaces like Claude Code. It supports official Claude models, Zhipu (GLM) series models, and custom models.
  4. Overview of Tesla API structure

    The Tesla API is divided into three primary functional areas:

    1. State and Command APIs: Used to retrieve point-in-time data (e.g., VIN, temperature, location) or trigger vehicle actions (e.g., honking, locking doors, remote start).
    2. Stream APIs: Provides telemetry data every 0.5 seconds for real-time tracking of location, charging, and driving metrics.
    3. Auto-parking (Summon) APIs: Requires EAP (Enhanced Autopilot) or FSD (Full Self-Driving) capability. Uses WebSockets to control vehicles equipped with HW1, HW2, or HW2.5 chips.
  5. Use Claude Code for repository analysis and automation

    Claude Code can directly read and analyze a local code repository without requiring manual copy-pasting. Key capabilities include:

    • Core Logic Analysis: Analyzing the overall architecture and logic of a repository.
    • Issue Detection: Identifying code quality, performance, and security vulnerabilities and applying fixes directly.
    • Git Automation: Performing git operations such as committing code, creating releases, merging PRs, and building/publishing images to a registry.
    • Documentation: Generating comprehensive README files based on the existing codebase.
  6. Manage insulin levels for weight loss

    Weight gain and the inability to lose weight are often driven by insulin resistance. High insulin levels keep the body's weight 'set point' high, making it harder to lose weight and increasing hunger. Factors that exacerbate insulin resistance include high intake of sugar and refined carbohydrates, chronic psychological stress (cortisol), and fatty liver. To lower insulin levels and improve sensitivity, focus on both what you eat and when you eat.
  7. Implement Agentic RAG for internal AI systems

    To solve common RAG (Retrieval-Augmented Generation) issues—such as poor accuracy with large document sets (80,000+ docs) and slow fixed workflows—transition to an 'Agentic RAG' model. In this approach, the AI autonomously determines the most appropriate RAG workflow based on the specific user task rather than following a rigid, predefined sequence.
  8. Create standalone pages using the src/pages directory

    To create a standalone page, add a Markdown or React file to the src/pages directory. The file path determines the URL route. For example:

    • src/pages/index.js maps to the root URL (/)
    • src/pages/foo.md maps to /foo
    • src/pages/foo/bar.js maps to /foo/bar
  9. Multi-node Deployment of Kimi K2.5 with vLLM

    For dual-node deployments (e.g., 2 * 8 * 96GB H20), ensure InfiniBand (IB) network is configured. Use --pipeline-parallel-size and --nnodes to distribute the model.
    # Master Node
    vllm serve $MODEL_PATH \
        --tool-call-parser kimi_k2 \
        --reasoning-parser kimi_k2 \
        --enable-auto-tool-choice \
        --enable-expert-parallel \
        --enable-chunked-prefill \
        --host 0.0.0.0 --port 8000 \
        --distributed-executor-backend mp \
        --pipeline-parallel-size 2 \
        --tensor-parallel-size 8 \
        --nnodes 2 --node-rank 0 \
        --served-model-name kimi-k2.5 \
        --master-addr $HEAD_NODE_IP \
        --trust-remote-code 
    
    # Worker Node
    vllm serve $MODEL_PATH \
        --tool-call-parser kimi_k2 \
        --reasoning-parser kimi_k2 \
        --enable-auto-tool-choice \
        --enable-expert-parallel \
        --enable-chunked-prefill \
        --host 0.0.0.0 --port 8000 \
        --distributed-executor-backend mp \
        --pipeline-parallel-size 2 \
        --tensor-parallel-size 8 \
        --nnodes 2 --node-rank 1 \
        --served-model-name kimi-k2.5 \
        --master-addr $HEAD_NODE_IP --headless\
        --trust-remote-code 
  10. Invoke a model for single and multi-turn conversations

    Use the invoke method to get a response from the model. For single queries, pass a string. For multi-turn conversations, pass a list of message objects (SystemMessage, HumanMessage, AIMessage) to maintain context.
    # Single turn
    response = model.invoke("Hello, who are you?")
    print(response.content)
    
    # Multi-turn conversation
    from langchain.schema import SystemMessage, HumanMessage, AIMessage
    
    conversation = [
        SystemMessage(content="You are a helpful assistant that translates English to Chinese."),
        HumanMessage(content="Translate: I love programming."),
        AIMessage(content="我爱编程"),
        HumanMessage(content="I love building applications.")
    ]
    response = model.invoke(conversation)
    print(response.content)
  11. Install LangChain and LLM provider supports

    LangChain supports Python (version 3.10+) and TypeScript. To install the core framework and specific provider supports for OpenAI or DeepSeek, use the following pip commands.
    # Install LangChain core (Python 3.10+ required)
    pip install -U langchain 
    
    # Install OpenAI support
    pip install -U langchain-openai 
    
    # Install DeepSeek support
    pip install -U langchain-deepseek