Skip to content

Commit

Permalink
Merge pull request #33 from restackio/espress-together-llama
Browse files Browse the repository at this point in the history
Example: Express, Together (llama) & LlamaIndex
  • Loading branch information
atapiawastaken authored Nov 7, 2024
2 parents 2702324 + 990d72a commit f0d030e
Show file tree
Hide file tree
Showing 22 changed files with 7,448 additions and 1 deletion.
11 changes: 11 additions & 0 deletions examples/express-together-llamaindex/.env.Example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# (Required) Example-specific environment variables

TOGETHER_API_KEY=

# (Optional) Restack Cloud - You only need to set these if you are using Restack Cloud

RESTACK_ENGINE_ID=
RESTACK_ENGINE_ADDRESS=
RESTACK_ENGINE_API_KEY=

RESTACK_CLOUD_TOKEN=
1 change: 1 addition & 0 deletions examples/express-together-llamaindex/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
42 changes: 42 additions & 0 deletions examples/express-together-llamaindex/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Build stage
FROM node:20-bullseye AS builder

WORKDIR /app

# Install pnpm
RUN npm install -g pnpm

# Copy package files and env file if it exists
COPY package*.json .env* ./

# Copy package files
COPY package*.json ./

# Install dependencies including TypeScript
RUN pnpm install
RUN pnpm add -D typescript

# Copy source code
COPY . .

# Build TypeScript code
RUN pnpm run build

# Production stage
FROM node:20-bullseye

WORKDIR /app

# Install pnpm
RUN npm install -g pnpm

# Copy package files and built code
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/dist ./dist

# Install production dependencies only
RUN pnpm install --prod

EXPOSE 8000

CMD ["pnpm", "tsx", "dist/server.js"]
40 changes: 40 additions & 0 deletions examples/express-together-llamaindex/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "restack-examples-ts-express-together-llamaindex",
"version": "0.0.1",
"description": "Basic Express example",
"scripts": {
"dev": "tsx watch --include src src/server.ts",
"clean": "rm -rf node_modules",
"build": "tsc --build",
"docker:build": "docker build -t restack-express-together-llamaindex .",
"docker:run": "docker run -p 8000:8000 --network restack-net --env-file .env --env RESTACK_ENGINE_ADDRESS=http://localhost:6233 restack-express-together-llamaindex",
"docker:dev": "pnpm docker:build && pnpm docker:run"
},
"nodemonConfig": {
"execMap": {
"ts": "ts-node"
},
"ext": "ts",
"watch": [
"src"
]
},
"dependencies": {
"@restackio/ai": "^0.0.80",
"@temporalio/workflow": "^1.11.2",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"llamaindex": "^0.8.4",
"together-ai": "^0.9.0",
"tsx": "^4.19.2",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.5"
},
"devDependencies": {
"@restackio/restack-sdk-cloud-ts": "^1.0.16",
"@types/express": "^5.0.0",
"@types/node": "^20.16.9",
"ts-node": "^10.9.2",
"typescript": "^5.6.3"
}
}
Loading

0 comments on commit f0d030e

Please sign in to comment.