recursive-llm-ts 5.2.3 → 5.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +59 -23
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -45,10 +45,30 @@ npm install recursive-llm-ts
45
45
  ### Prerequisites
46
46
 
47
47
  - **Node.js 16+**
48
- - **Go 1.25+** (for building from source during install)
49
- ### Go Binary (Automatic)
48
+ - **Go 1.25+** (only if you need to build the Go binary from source)
50
49
 
51
- The `postinstall` script automatically builds the Go binary during installation. If Go is not available, the script will warn but not fail.
50
+ ### Go Binary Resolution
51
+
52
+ On supported platforms, npm installs a matching pre-built binary package automatically:
53
+
54
+ - `@recursive-llm/darwin-arm64`
55
+ - `@recursive-llm/darwin-x64`
56
+ - `@recursive-llm/linux-x64`
57
+ - `@recursive-llm/linux-arm64`
58
+ - `@recursive-llm/win32-x64`
59
+
60
+ This is the default path for most Linux containers, so Go is usually not required in container images.
61
+
62
+ The bridge resolves the binary in this order:
63
+
64
+ 1. `config.go_binary_path`
65
+ 2. `RLM_GO_BINARY`
66
+ 3. Matching `@recursive-llm/<platform>` package
67
+ 4. Local `bin/rlm-go` or `go/rlm-go`
68
+
69
+ ### Go Binary (Automatic Fallback)
70
+
71
+ When no matching pre-built binary is available, the `postinstall` script attempts to build the Go binary during installation. If Go is not available, the script will warn but not fail.
52
72
 
53
73
  If you need to build manually:
54
74
 
@@ -1012,36 +1032,50 @@ See the [LiteLLM documentation](https://docs.litellm.ai/docs/providers) for the
1012
1032
 
1013
1033
  ## Docker Deployment
1014
1034
 
1015
- ### Basic Dockerfile with Go Build
1035
+ ### Option 1: Use the Published Linux Binary Package
1016
1036
 
1017
- To containerize your application that uses `recursive-llm-ts`, install Go 1.25+ in your Docker image to build the binary during `npm install`:
1037
+ On `linux-x64` and `linux-arm64`, `npm ci --omit=dev` installs the matching `@recursive-llm/linux-*` package automatically. This is the simplest container setup and does not require Go or `RLM_GO_BINARY`.
1018
1038
 
1019
1039
  ```dockerfile
1020
- FROM node:20-alpine
1040
+ FROM node:22-alpine
1041
+ WORKDIR /app
1021
1042
 
1022
- # Install Go 1.25+ for building the RLM binary
1023
- RUN apk add --no-cache go
1043
+ COPY package*.json ./
1044
+ RUN npm ci --omit=dev
1024
1045
 
1025
- # Set Go environment
1026
- ENV GOPATH=/go
1027
- ENV PATH=$PATH:$GOPATH/bin
1046
+ COPY . .
1028
1047
 
1048
+ ENV OPENAI_API_KEY=""
1049
+ ENV NODE_ENV=production
1050
+
1051
+ CMD ["node", "your-app.js"]
1052
+ ```
1053
+
1054
+ ### Option 2: Copy or Mount a Custom Binary
1055
+
1056
+ Use this when you build the Go binary elsewhere and want to point the package at an explicit path.
1057
+
1058
+ ```dockerfile
1059
+ FROM node:22-alpine
1029
1060
  WORKDIR /app
1030
1061
 
1031
1062
  COPY package*.json ./
1032
- RUN npm install
1063
+ RUN npm ci --omit=dev --ignore-scripts
1033
1064
 
1034
1065
  COPY . .
1066
+ COPY ./bin/rlm-go /app/bin/rlm-go
1067
+ RUN chmod +x /app/bin/rlm-go
1035
1068
 
1036
1069
  ENV OPENAI_API_KEY=""
1037
1070
  ENV NODE_ENV=production
1071
+ ENV RLM_GO_BINARY=/app/bin/rlm-go
1038
1072
 
1039
1073
  CMD ["node", "your-app.js"]
1040
1074
  ```
1041
1075
 
1042
- ### Multi-Stage Build (Recommended for Production)
1076
+ ### Option 3: Build from Source in a Multi-Stage Image
1043
1077
 
1044
- For optimal image size and security, use a multi-stage build:
1078
+ Use this for unsupported targets or when you need a custom-compiled binary.
1045
1079
 
1046
1080
  ```dockerfile
1047
1081
  # Stage 1: Build the Go binary
@@ -1053,30 +1087,29 @@ COPY go/ ./
1053
1087
  RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o rlm-go ./cmd/rlm
1054
1088
 
1055
1089
  # Stage 2: Build Node.js dependencies
1056
- FROM node:20-alpine AS node-builder
1090
+ FROM node:22-alpine AS node-builder
1057
1091
  WORKDIR /app
1058
1092
  COPY package*.json ./
1059
- RUN npm ci --omit=dev
1093
+ RUN npm ci --omit=dev --ignore-scripts
1060
1094
 
1061
1095
  # Stage 3: Final runtime image
1062
- FROM node:20-alpine
1096
+ FROM node:22-alpine
1063
1097
  WORKDIR /app
1064
1098
 
1065
1099
  COPY --from=node-builder /app/node_modules ./node_modules
1066
1100
  COPY --from=go-builder /build/rlm-go ./bin/rlm-go
1067
1101
  RUN chmod +x ./bin/rlm-go
1068
1102
 
1069
- COPY package*.json ./
1070
- COPY dist/ ./dist/
1103
+ COPY . .
1071
1104
 
1072
1105
  ENV NODE_ENV=production
1073
1106
  ENV RLM_GO_BINARY=/app/bin/rlm-go
1074
1107
  ENV OPENAI_API_KEY=""
1075
1108
 
1076
- CMD ["node", "dist/index.js"]
1109
+ CMD ["node", "your-app.js"]
1077
1110
  ```
1078
1111
 
1079
- **Benefits:** Smaller image (~150MB vs ~500MB), faster builds with caching, more secure.
1112
+ **Benefits:** Small runtime image, deterministic binary path, and no Go toolchain in the final image.
1080
1113
 
1081
1114
  ### Docker Compose
1082
1115
 
@@ -1101,8 +1134,11 @@ RUN apk add --no-cache go
1101
1134
  # Debian/Ubuntu
1102
1135
  RUN apt-get update && apt-get install -y golang-1.25
1103
1136
 
1104
- # Or use pre-built binary (no Go required)
1105
- # Download from GitHub releases and copy to /app/bin/rlm-go
1137
+ # Or use the published platform package (no Go required)
1138
+ # npm ci --omit=dev installs @recursive-llm/linux-x64 or @recursive-llm/linux-arm64 automatically
1139
+
1140
+ # Or use a release binary explicitly
1141
+ # Download from GitHub Releases and set RLM_GO_BINARY=/app/bin/rlm-go
1106
1142
  ```
1107
1143
 
1108
1144
  ## Using the Go Module Directly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recursive-llm-ts",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
4
4
  "description": "TypeScript bridge for recursive-llm: Recursive Language Models for unbounded context processing with structured outputs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -80,11 +80,11 @@
80
80
  "vitest": "^4.0.18"
81
81
  },
82
82
  "optionalDependencies": {
83
- "@recursive-llm/darwin-arm64": "5.2.3",
84
- "@recursive-llm/darwin-x64": "5.2.3",
85
- "@recursive-llm/linux-x64": "5.2.3",
86
- "@recursive-llm/linux-arm64": "5.2.3",
87
- "@recursive-llm/win32-x64": "5.2.3"
83
+ "@recursive-llm/darwin-arm64": "5.2.4",
84
+ "@recursive-llm/darwin-x64": "5.2.4",
85
+ "@recursive-llm/linux-x64": "5.2.4",
86
+ "@recursive-llm/linux-arm64": "5.2.4",
87
+ "@recursive-llm/win32-x64": "5.2.4"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "@aws-sdk/client-s3": "^3.0.0"