Skip to content

Commit f0d030e

Browse files
Merge pull request #33 from restackio/espress-together-llama
Example: Express, Together (llama) & LlamaIndex
2 parents 2702324 + 990d72a commit f0d030e

22 files changed

+7448
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# (Required) Example-specific environment variables
2+
3+
TOGETHER_API_KEY=
4+
5+
# (Optional) Restack Cloud - You only need to set these if you are using Restack Cloud
6+
7+
RESTACK_ENGINE_ID=
8+
RESTACK_ENGINE_ADDRESS=
9+
RESTACK_ENGINE_API_KEY=
10+
11+
RESTACK_CLOUD_TOKEN=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Build stage
2+
FROM node:20-bullseye AS builder
3+
4+
WORKDIR /app
5+
6+
# Install pnpm
7+
RUN npm install -g pnpm
8+
9+
# Copy package files and env file if it exists
10+
COPY package*.json .env* ./
11+
12+
# Copy package files
13+
COPY package*.json ./
14+
15+
# Install dependencies including TypeScript
16+
RUN pnpm install
17+
RUN pnpm add -D typescript
18+
19+
# Copy source code
20+
COPY . .
21+
22+
# Build TypeScript code
23+
RUN pnpm run build
24+
25+
# Production stage
26+
FROM node:20-bullseye
27+
28+
WORKDIR /app
29+
30+
# Install pnpm
31+
RUN npm install -g pnpm
32+
33+
# Copy package files and built code
34+
COPY --from=builder /app/package*.json ./
35+
COPY --from=builder /app/dist ./dist
36+
37+
# Install production dependencies only
38+
RUN pnpm install --prod
39+
40+
EXPOSE 8000
41+
42+
CMD ["pnpm", "tsx", "dist/server.js"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "restack-examples-ts-express-together-llamaindex",
3+
"version": "0.0.1",
4+
"description": "Basic Express example",
5+
"scripts": {
6+
"dev": "tsx watch --include src src/server.ts",
7+
"clean": "rm -rf node_modules",
8+
"build": "tsc --build",
9+
"docker:build": "docker build -t restack-express-together-llamaindex .",
10+
"docker:run": "docker run -p 8000:8000 --network restack-net --env-file .env --env RESTACK_ENGINE_ADDRESS=http://localhost:6233 restack-express-together-llamaindex",
11+
"docker:dev": "pnpm docker:build && pnpm docker:run"
12+
},
13+
"nodemonConfig": {
14+
"execMap": {
15+
"ts": "ts-node"
16+
},
17+
"ext": "ts",
18+
"watch": [
19+
"src"
20+
]
21+
},
22+
"dependencies": {
23+
"@restackio/ai": "^0.0.80",
24+
"@temporalio/workflow": "^1.11.2",
25+
"dotenv": "^16.4.5",
26+
"express": "^4.21.1",
27+
"llamaindex": "^0.8.4",
28+
"together-ai": "^0.9.0",
29+
"tsx": "^4.19.2",
30+
"zod": "^3.23.8",
31+
"zod-to-json-schema": "^3.23.5"
32+
},
33+
"devDependencies": {
34+
"@restackio/restack-sdk-cloud-ts": "^1.0.16",
35+
"@types/express": "^5.0.0",
36+
"@types/node": "^20.16.9",
37+
"ts-node": "^10.9.2",
38+
"typescript": "^5.6.3"
39+
}
40+
}

0 commit comments

Comments
 (0)