Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ The backend python workflow and frontend ui share values from this single file.

These apps are built on top of `llama_deploy`, which comes bundled with a `llamactl` cli for serving your workflows as an API, and your app, side by side.

You can serve it locally with `uv run llamactl serve llama_deploy.local` from within this directory.
You can serve it locally with `uvx llamactl serve` from within this directory.

After starting with `llamactl`, visit `http://localhost:4501/deployments/{{package_name}}/ui` to see the UI.
After starting with `llamactl`, visit `http://localhost:4501/deployments/{{ project_name }}/ui` to see the UI.

## Exporting types

Expand Down
25 changes: 0 additions & 25 deletions llama_deploy.local.jinja

This file was deleted.

10 changes: 2 additions & 8 deletions llama_deploy.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ default-service: process-file
services:
process-file:
name: Process File
source:
type: local
name: .
sync_policy: merge
path: "src/{{project_name_snake}}.process_file:workflow"
python-dependencies:
- "."
env-files:
- ".env"

ui:
name: "{{project_name}} UI"
source:
type: local
name: ./ui
sync_policy: merge
4 changes: 2 additions & 2 deletions test-proj/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ The backend python workflow and frontend ui share values from this single file.

These apps are built on top of `llama_deploy`, which comes bundled with a `llamactl` cli for serving your workflows as an API, and your app, side by side.

You can serve it locally with `uv run llamactl serve llama_deploy.local` from within this directory.
You can serve it locally with `uvx llamactl serve` from within this directory.

After starting with `llamactl`, visit `http://localhost:4501/deployments//ui` to see the UI.
After starting with `llamactl`, visit `http://localhost:4501/deployments/test-proj/ui` to see the UI.

## Exporting types

Expand Down
25 changes: 0 additions & 25 deletions test-proj/llama_deploy.local

This file was deleted.

10 changes: 2 additions & 8 deletions test-proj/llama_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ default-service: process-file
services:
process-file:
name: Process File
source:
type: local
name: .
sync_policy: merge
path: "src/test_proj.process_file:workflow"
python-dependencies:
- "."
env-files:
- ".env"

ui:
name: "test-proj UI"
source:
type: local
name: ./ui
sync_policy: merge
2 changes: 1 addition & 1 deletion test-proj/ui/src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EXTRACTED_DATA_COLLECTION } from "./config";

const platformToken = import.meta.env.VITE_LLAMA_CLOUD_API_KEY;
const apiBaseUrl = import.meta.env.VITE_LLAMA_CLOUD_BASE_URL;
const projectId = import.meta.env.VITE_LLAMA_CLOUD_PROJECT_ID;
const projectId = import.meta.env.VITE_LLAMA_DEPLOY_PROJECT_ID;

// Configure the platform client
cloudApiClient.setConfig({
Expand Down
9 changes: 3 additions & 6 deletions test-proj/ui/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import { HashRouter } from "react-router-dom";
import App from "./App";
import "@llamaindex/ui/styles.css";
import "./index.css";

// https://github.com/run-llama/llama_deploy/blob/main/llama_deploy/apiserver/deployment.py#L183
const base = import.meta.env.VITE_LLAMA_DEPLOY_BASE_PATH ?? "/";

createRoot(document.getElementById("root")!).render(
<StrictMode>
<BrowserRouter basename={base}>
<HashRouter>
<App />
</BrowserRouter>
</HashRouter>
</StrictMode>,
);
8 changes: 4 additions & 4 deletions test-proj/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import path from "path";

// https://vitejs.dev/config/
export default defineConfig(({}) => {
const deploymentId = process.env.LLAMA_DEPLOY_NEXTJS_DEPLOYMENT_NAME;
const basePath = `/deployments/${deploymentId}/ui`;
const deploymentId = process.env.LLAMA_DEPLOY_DEPLOYMENT_URL_ID;
const basePath = process.env.LLAMA_DEPLOY_DEPLOYMENT_BASE_PATH;
const projectId = process.env.LLAMA_DEPLOY_PROJECT_ID;

return {
Expand All @@ -30,9 +30,9 @@ export default defineConfig(({}) => {
define: {
"import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME":
JSON.stringify(deploymentId),
"import.meta.env.VITE_LLAMA_DEPLOY_BASE_PATH": JSON.stringify(basePath),
"import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_BASE_PATH": JSON.stringify(basePath),
...(projectId && {
"import.meta.env.VITE_LLAMA_CLOUD_PROJECT_ID":
"import.meta.env.VITE_LLAMA_DEPLOY_PROJECT_ID":
JSON.stringify(projectId),
}),
},
Expand Down
2 changes: 1 addition & 1 deletion ui/src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EXTRACTED_DATA_COLLECTION } from "./config";

const platformToken = import.meta.env.VITE_LLAMA_CLOUD_API_KEY;
const apiBaseUrl = import.meta.env.VITE_LLAMA_CLOUD_BASE_URL;
const projectId = import.meta.env.VITE_LLAMA_CLOUD_PROJECT_ID;
const projectId = import.meta.env.VITE_LLAMA_DEPLOY_PROJECT_ID;

// Configure the platform client
cloudApiClient.setConfig({
Expand Down
9 changes: 3 additions & 6 deletions ui/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import { HashRouter } from "react-router-dom";
import App from "./App";
import "@llamaindex/ui/styles.css";
import "./index.css";

// https://github.com/run-llama/llama_deploy/blob/main/llama_deploy/apiserver/deployment.py#L183
const base = import.meta.env.VITE_LLAMA_DEPLOY_BASE_PATH ?? "/";

createRoot(document.getElementById("root")!).render(
<StrictMode>
<BrowserRouter basename={base}>
<HashRouter>
<App />
</BrowserRouter>
</HashRouter>
</StrictMode>,
);
8 changes: 4 additions & 4 deletions ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import path from "path";

// https://vitejs.dev/config/
export default defineConfig(({}) => {
const deploymentId = process.env.LLAMA_DEPLOY_NEXTJS_DEPLOYMENT_NAME;
const basePath = `/deployments/${deploymentId}/ui`;
const deploymentId = process.env.LLAMA_DEPLOY_DEPLOYMENT_URL_ID;
const basePath = process.env.LLAMA_DEPLOY_DEPLOYMENT_BASE_PATH;
const projectId = process.env.LLAMA_DEPLOY_PROJECT_ID;

return {
Expand All @@ -30,9 +30,9 @@ export default defineConfig(({}) => {
define: {
"import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME":
JSON.stringify(deploymentId),
"import.meta.env.VITE_LLAMA_DEPLOY_BASE_PATH": JSON.stringify(basePath),
"import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_BASE_PATH": JSON.stringify(basePath),
...(projectId && {
"import.meta.env.VITE_LLAMA_CLOUD_PROJECT_ID":
"import.meta.env.VITE_LLAMA_DEPLOY_PROJECT_ID":
JSON.stringify(projectId),
}),
},
Expand Down