OSS Connector for AI/ML lets you load large inference models directly from OSS at full network bandwidth. This tutorial deploys a 664 GB DeepSeek-R2 model on a single node using llama.cpp, then shows how to scale that deployment to a multi-node cluster using a peer-to-peer (P2P) distribution system.
Choose a hardware configuration
This tutorial uses ecs.g8i.48xlarge: 192-core CPU, 1 TiB of memory, and a 100 Gbit/s base network bandwidth.
How OSS Connector for AI/ML works
OSS Connector for AI/ML intercepts file I/O calls at the OS level using LD_PRELOAD, redirecting reads to OSS without requiring changes to your inference framework.
Key capabilities:
Out-of-the-box integration: Works with mainstream frameworks without code modification.
100 GB models in seconds: User-mode I/O delivers performance several times higher than Filesystem in Userspace (FUSE)-based tools.
100% bandwidth utilization: A self-developed high-concurrency network module fully saturates OSS throughput.
Smart prefetch cache: Preloads hot data into memory to reduce inference latency.
Why use OSS for model loading
| Advantage | Details |
|---|---|
| High throughput and concurrency | Distributed architecture supports parallel reads across multiple data clusters. Stateless access endpoints scale horizontally to fully utilize available network bandwidth. |
| Low-cost tiered storage | Object versioning tracks model iterations automatically. Lifecycle policies automate storage class transitions to reduce long-term retention costs. |
| High reliability | 99.9999999999% (12 nines) data durability and 99.995% availability keep inference services running without storage-related interruptions. |
| Efficient distribution | Natively suited for distributed access across inference nodes. Fine-grained authorization policies enable secure model sharing across teams. |
Prerequisites
Before you begin, make sure you have:
An ECS instance of type
ecs.g8i.48xlargeAn OSS bucket in the same region as your ECS instance, with
oss:ListObjectspermission on the target directoryThe Q8-quantized GGUF version of DeepSeek-R2 (664 GB) uploaded to the bucket via the internal endpoint using ossutil (upload reference)
Deploy the inference service on a single node
Step 1: Set up the network environment
Create an ECS instance on the Elastic Compute Service (ECS) instances page, using the
ecs.g8i.48xlargeinstance type.
Create an Elastic Network Interface (ENI) on the ENIs page. The ENI must be in the same virtual private cloud (VPC) as the ECS instance. Aggregating bandwidth from multiple ENIs lets you exceed the single-ENI bandwidth cap when accessing OSS within the VPC.
Note the IP addresses of the attached ENIs — you will need them when configuring OSS Connector.

Step 2: Install the inference framework
This tutorial uses llama.cpp, which supports efficient loading and inference of GGUF-format models.
To build from source:
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
mkdir build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseStep 3: Install OSS Connector
Download and install the package.
wget https://gosspublic.alicdn.com/oss-connector/oss-connector-lib-1.1.0rc7.x86_64.rpm yum install -y oss-connector-lib-1.1.0rc7.x86_64.rpmEdit the configuration file at
/etc/oss-connector/config.json.{ "logLevel": 1, "logPath": "/var/log/oss-connector/connector.log", "auditPath": "/var/log/oss-connector/audit.log", "expireTimeSec": 120, "prefetch": { "vcpus": 32, "workers": 32 } }
Step 4: Configure OSS Connector
Set the following environment variables so OSS Connector can authenticate and locate the model:
export OSS_ACCESS_KEY_ID=<your-access-key-id>
export OSS_ACCESS_KEY_SECRET=<your-access-key-secret>
export OSS_REGION=cn-beijing
export OSS_ENDPOINT=oss-cn-beijing-internal.aliyuncs.com
export OSS_PATH=oss://<BUCKET-NAME>/deepseek/DeepSeek-R2-Q8_0/
export MODEL_DIR=/tmp/model/DeepSeek-R2-Q8_0/
export HTTP_SOURCE_IP=172.xx.x.xxx,172.xx.x.xxx| Variable | Description |
|---|---|
OSS_ACCESS_KEY_ID | AccessKey ID of an Alibaba Cloud account or Resource Access Management (RAM) user. When using a temporary Security Token Service (STS) credential, set this to the credential's AccessKey ID. If the bucket supports anonymous access, leave this blank. |
OSS_ACCESS_KEY_SECRET | AccessKey secret corresponding to OSS_ACCESS_KEY_ID. |
OSS_SESSION_TOKEN | Temporary access token when using STS credentials. Leave blank when using an AccessKey pair directly. |
OSS_ENDPOINT | OSS service endpoint, for example http://oss-cn-beijing-internal.aliyuncs.com. Defaults to HTTPS if no protocol is specified. Use HTTP on internal networks for better performance. |
OSS_REGION | OSS region ID, for example cn-beijing. If not set, authentication may fail. |
OSS_PATH | OSS path to the model directory in oss://bucketname/path/ format, for example oss://examplebucket/deepseek/DeepSeek-R2-Q8_0/. |
MODEL_DIR | Local path where the connector maps model files, for example /tmp/model/DeepSeek-R2-Q8_0/. |
HTTP_SOURCE_IP | Comma-separated IP addresses of the ENIs for the connector to use (for example 172.16.6.121,172.16.6.122). Linux automatically selects the corresponding network interfaces and routes traffic based on these IPs. For fine-grained traffic splitting by source IP or destination address, configure policy-based routing with ip rule and custom route tables. |
Step 5: Start the inference service
LD_PRELOAD=/usr/local/lib/libossc_preload.so ENABLE_CONNECTOR=1 llama-server \
-m /tmp/model/DeepSeek-R2-Q8_0/DeepSeek-R2.Q8_0-00001-of-00015.gguf \
-t 48 -c 1024 --host 0.0.0.0 --port 9090 --numa isolateLD_PRELOAD loads the OSS Connector library before the process starts, intercepting I/O calls transparently.
Step 6: Verify performance
After the service starts, internal network bandwidth on the ECS instance saturates within about one minute:

Both ENIs run at capacity, with combined bandwidth held continuously at 100 Gbit/s:

The following table compares end-to-end startup time across loading tools. Startup time is measured from process launch to when llama.cpp logs that the model is ready.
| Loading tool | End-to-end startup time | OSS single-account bandwidth limit | Actual bandwidth used | Total data read from OSS |
|---|---|---|---|---|
| OSS Connector for AI/ML | 81s | 100 Gbit/s | 100 Gbit/s | 664 GB |
| ossfs 2.0 | 257s | 100 Gbit/s | 20 Gbit/s | 666 GB |
| ossfs 1.0 | 1020s | 100 Gbit/s | 6.4 Gbit/s | 782 GB |
Scale to large inference clusters with P2P distribution
Overview
When hundreds of inference nodes start simultaneously and all pull the same model from OSS, concurrent back-to-origin traffic can exceed single-account bandwidth limits and slow startup across the cluster.
OSS Connector for AI/ML can work with a peer-to-peer (P2P) distribution system designed for this scenario. Nodes share model data with each other, reducing the load on OSS while preserving the connector's low-latency, high-throughput initial data access. The system supports on-demand distribution and can perform random and streaming reads of large files.
Key properties:
Peak traffic reduction: Node-to-node sharing cuts direct OSS requests during concurrent startup, reducing instantaneous pressure on the central data source.
Sustained performance: Raw data is still pulled from OSS via the connector, preserving low latency and high throughput for initial access.
Horizontal scaling: Supports clusters of hundreds of nodes with startup times close to single-node performance.
Reduced back-to-origin traffic: Local caching and P2P sharing minimize repeated data pulls from OSS, improving overall resource utilization.
Test environment
| Parameter | Value |
|---|---|
| Model | DeepSeek-R2, Q8-quantized GGUF format, 664 GB |
| Cluster | 50 ecs.g8i.48xlarge instances managed by Container Service for Kubernetes (ACK) |
| Framework | llama.cpp running as the main process in each container |
| Measurement | Startup time per node from process launch to the llama.cpp model-ready log entry |
Test results
| Average end-to-end startup time | OSS single-account bandwidth limit | Total data read from OSS |
|---|---|---|
| 127s | 100 Gbit/s | 1,262 GB |
Key findings
The average startup time across 50 nodes was approximately 1.5x that of a single node (127s vs. 81s). Total back-to-origin data volume was about 1,262 GB — roughly twice the 664 GB model size — because each unique data block was fetched from OSS once and then distributed via P2P to the remaining nodes.
Even in this high-concurrency environment, startup times remained stable and did not increase proportionally with the number of nodes, demonstrating effective horizontal scaling.