-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from restackio/espress-together-llama
Example: Express, Together (llama) & LlamaIndex
- Loading branch information
Showing
22 changed files
with
7,448 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Oops, something went wrong.