Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
ec4e12d
wip
h4r5h4 May 27, 2024
a7e9bbf
update env location
h4r5h4 May 28, 2024
79fa7f5
make user id optional for uploads
h4r5h4 May 28, 2024
d450bd4
chore: Improve loading Ollama model (#19)
leehuwuj May 28, 2024
4b64a09
bump llamaindex and gemini package (#26)
leehuwuj May 31, 2024
50537ff
feat: Add support for Azure OpenAI provider (#25)
leehuwuj May 31, 2024
cd4259e
relock package (#28)
leehuwuj May 31, 2024
5fdb49f
docs: add Linux GPU instruction (#31)
DipFlip Jun 1, 2024
19dd08b
docs: use latest Docker
marcusschiesser Jun 2, 2024
9397e4c
chore: add ada embedding
marcusschiesser Jun 2, 2024
8fdb09a
ci: improve release process
marcusschiesser Jun 2, 2024
9b8ae5c
Release 0.0.8 (#27)
github-actions[bot] Jun 3, 2024
edc54ff
ci: fix permission for creating release
marcusschiesser Jun 3, 2024
01ee353
Merge branch 'main' of https://github.com/ragapp/ragapp into context-id
h4r5h4 Jun 3, 2024
c5fb95d
Update README.md
marcusschiesser Jun 4, 2024
8803c69
fix: Azure OpenAI key conflicting, not using system prompt, add endpo…
leehuwuj Jun 4, 2024
31d2427
docs: clarify authentication
marcusschiesser Jun 6, 2024
7084d12
Merge branch 'main' of https://github.com/ragapp/ragapp into context-id
h4r5h4 Jun 6, 2024
1877c24
support url downloads
h4r5h4 Jun 6, 2024
9ea1cda
feat: Bump create-llama 0.1.9 and update patches (#41)
leehuwuj Jun 10, 2024
e559534
feat: add config for conversation starter questions (#42)
leehuwuj Jun 12, 2024
bd2ff2d
chore(deps): bump azure-identity from 1.16.0 to 1.16.1 (#45)
dependabot[bot] Jun 12, 2024
39c1b1a
fix: remove patch files related to chat secion
thucpn Jun 12, 2024
a488880
fix: no need container
thucpn Jun 12, 2024
006e0b2
Merge branch 'main' of https://github.com/ragapp/ragapp into context-id
h4r5h4 Jun 12, 2024
167c549
bump create-llama version to 0.1.10
leehuwuj Jun 13, 2024
f7dc582
add changeset
leehuwuj Jun 13, 2024
81340d9
Merge pull request #48 from ragapp/fix/remove-patch-files-related-to-…
thucpn Jun 13, 2024
fef1d1a
fix update mounting static files and add timeout config for Ollama (#49)
leehuwuj Jun 13, 2024
9dd1704
feat: support Llama Parse (#46)
leehuwuj Jun 13, 2024
555f613
ci: try new publish
marcusschiesser Jun 13, 2024
9aa4019
ci: removed redundant changeset
marcusschiesser Jun 13, 2024
97ac23a
chore(deps-dev): bump braces from 3.0.2 to 3.0.3 (#47)
dependabot[bot] Jun 13, 2024
ef0d95f
better handler mounting and fix missing html for front-end static (#50)
leehuwuj Jun 13, 2024
67c3ac5
Fix the issue with losing chat config when switching providers (#51)
leehuwuj Jun 13, 2024
047456d
Release 0.0.9 (#34)
github-actions[bot] Jun 13, 2024
e45c7e5
fix: use version from package.json
marcusschiesser Jun 13, 2024
e2359a1
Merge branch 'main' of https://github.com/ragapp/ragapp into context-id
h4r5h4 Jun 18, 2024
ea6467e
fix reset
h4r5h4 Jun 18, 2024
0b08d04
chore(deps): bump deps in /admin (#52)
dependabot[bot] Jun 18, 2024
5091e11
chore(deps): bump urllib3 from 2.2.1 to 2.2.2 (#59)
dependabot[bot] Jun 18, 2024
bb6622e
dx: use pnpm everywhere (#60)
marcusschiesser Jun 18, 2024
77295ab
dynamic topk
h4r5h4 Jun 19, 2024
4f178a6
Auto-submit forms on focus lost and improved UX for uploading files. …
leehuwuj Jun 19, 2024
d8a0f60
disable dynamic topk
h4r5h4 Jun 19, 2024
16be790
fix param
h4r5h4 Jun 19, 2024
4cfe656
feat: add openapi tool config and bump create-llama 0.1.11 (#64)
leehuwuj Jun 20, 2024
4f6483a
fix redirect and add deps for openapi tool (#65)
leehuwuj Jun 20, 2024
969374e
feat: Add E2B code interpreter tool (#66)
leehuwuj Jun 20, 2024
d233397
feat: add hackernews example
marcusschiesser Jun 20, 2024
27547d7
fix: upgrade chromadb to 0.5.1 to force numpy < 2.0.0
marcusschiesser Jun 20, 2024
6aea877
Release 0.0.10 (#62)
github-actions[bot] Jun 20, 2024
6157cc9
support chroma auth
h4r5h4 Jun 20, 2024
e893d24
disable frontend
h4r5h4 Jun 20, 2024
1ceec37
feat: Add image generator (#70)
leehuwuj Jun 24, 2024
4d290b5
ci: disable git tag/push
marcusschiesser Jun 24, 2024
4b5a8cc
Release 0.0.11 (#73)
github-actions[bot] Jun 24, 2024
debfe4e
refactor: start using mutations (#63)
marcusschiesser Jun 24, 2024
0342480
Construct system prompt from custom prompt and tool custom prompts (#75)
leehuwuj Jun 25, 2024
79209f2
Add Groq provider (#77)
marcusschiesser Jun 27, 2024
b094953
ci: update github actions for docker build
marcusschiesser Jun 29, 2024
f52f51b
add back checkout step
leehuwuj Jul 1, 2024
28a2ea0
Merge pull request #85 from ragapp/leehuwuj-patch-1
leehuwuj Jul 1, 2024
76e0489
Revert "Add Groq provider (#77) " (#89)
leehuwuj Jul 3, 2024
d901b4e
feat: Add embedding model and base url config for OpenAI provider (#88)
leehuwuj Jul 3, 2024
376592f
Release 0.0.12 (#74)
github-actions[bot] Jul 3, 2024
84bd368
docs: added linux special cases
marcusschiesser Jul 3, 2024
c7cbb6e
feat: Add T-Systems model provider (#92)
leehuwuj Jul 4, 2024
7d3c814
fix: add missing openai-like dep
marcusschiesser Jul 4, 2024
c96b525
Release 0.0.13 (#94)
github-actions[bot] Jul 4, 2024
6c7f7aa
feat: use llamacloud in ragapp (#90)
thucpn Jul 5, 2024
8bb696c
Release 0.0.14 (#96)
github-actions[bot] Jul 5, 2024
b7b1f7f
chore: bump llama-index version (#101)
leehuwuj Jul 9, 2024
b592cd9
Release 0.0.15 (#102)
github-actions[bot] Jul 9, 2024
fc48b51
disable watch
h4r5h4 Jul 10, 2024
4dc21b8
sync with main
h4r5h4 Jul 10, 2024
9598769
evals
h4r5h4 Jul 10, 2024
ade3163
feat: Add Mistral AI provider (#104)
leehuwuj Jul 11, 2024
f553c14
Release 0.0.16 (#106)
github-actions[bot] Jul 11, 2024
e702509
Merge branch 'main' of https://github.com/ragapp/ragapp into context-id
h4r5h4 Jul 12, 2024
e7d3381
fix
h4r5h4 Jul 12, 2024
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
12 changes: 11 additions & 1 deletion .github/workflows/docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
release_tagged_image:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out the code
uses: actions/checkout@v2
Expand Down Expand Up @@ -39,6 +41,14 @@ jobs:
ragapp/ragapp:${{ steps.tag.outputs.TAG }}
ragapp/ragapp:latest

- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
artifacts: "README.md"
name: Release ${{ steps.tag.outputs.TAG }}
bodyFile: "CHANGELOG.md"
token: ${{ secrets.GITHUB_TOKEN }}

release_dev_image:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
Expand All @@ -60,7 +70,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/lint_on_push_or_pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'admin'
working-directory: "admin"
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "pnpm"

- name: Install dependencies
run: npm install
run: pnpm install

- name: Run lint
run: npm run lint
run: pnpm run lint

- name: Run Prettier
run: npm run format
run: pnpm run format

linting-python:
runs-on: ubuntu-latest
strategy:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ jobs:
with:
commit: Release ${{ steps.get-changeset-status.outputs.new-version }}
title: Release ${{ steps.get-changeset-status.outputs.new-version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Tag and Push Release
if: steps.changesets.outputs.published == 'true'
run: |
git tag v${{ steps.get-changeset-status.outputs.new-version }}
git push origin v${{ steps.get-changeset-status.outputs.new-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Tag and Push Release
# if: steps.changesets.outputs.hasChangesets == 'false'
# run: |
# # version is already in package.json - just tag and push
# new_version=$(jq -r '.version' < package.json)
# git tag v${new_version}
# git push origin v${new_version}
# # TODO: trigger job 'release_tagged_image' (is not triggered by git push)
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ storage/

**/.env

**/.mypy_cache/

data/
node_modules/
create_llama/
ollama/
tool-output/

!config/*
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
# ragbox

## 0.0.16

### Patch Changes

- ade3163: Add Mistral AI provider

## 0.0.15

### Patch Changes

- b7b1f7f: Bump llama-index version to 0.10.53

## 0.0.14

### Patch Changes

- 6c7f7aa: Add support for LlamaCloud

## 0.0.13

### Patch Changes

- c7cbb6e: Bump create-llama version to 0.1.17
- c7cbb6e: Add support for T-Systems provider

## 0.0.12

### Patch Changes

- d901b4e: Add embedding model and base api config for OpenAI provider
- debfe4e: Add loading state to forms
- 0342480: Add custom tool prompt to system prompt

## 0.0.11

### Patch Changes

- 1ceec37: Bump create-llama version to 0.1.13
- 1ceec37: Add image generator tool

## 0.0.10

### Patch Changes

- 4cfe656: Add OpenAPI tool config
- 969374e: Add e2b code interpreter
- 4cfe656: Bump create-llama version to 0.1.11
- 4f178a6: Auto-submit forms on focus lost, clarified start up and improved UX for uploading files.

## 0.0.9

### Patch Changes

- fef1d1a: Fix not showing file viewer
- 67c3ac5: Fix the issue with losing chat config when switching providers
- 9dd1704: Add a new config for Llama parse
- 8803c69: Fix system prompt not working and improved Azure OpenAI validation
- f7dc582: Bump create-llama version to 0.1.10
- fef1d1a: Add timeout config for Ollama requests
- e559534: Add config for conversation starter questions

## 0.0.8

### Patch Changes

- 50537ff: Add support for Azure OpenAI provider

## 0.0.7

### Patch Changes
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# ======= FRONT-END BUILD ==========
FROM node:20-alpine as build

# Install pnpm
RUN npm install -g [email protected]

# Install make
RUN apk add --no-cache make

Expand All @@ -10,6 +13,7 @@ COPY Makefile .
COPY admin ./admin
COPY patch/frontend ./patch/frontend
COPY patch/backend ./patch/backend
COPY create_llama_local ./create_llama_local

# Build static files for the Chat UI
RUN make build-frontends
Expand All @@ -35,8 +39,8 @@ COPY poetry.lock pyproject.toml ./
RUN poetry install --no-root --no-cache --only main

# Copy static files from the build stage
COPY --from=build /app/create_llama/frontend/out /app/static
COPY --from=build /app/admin/out /app/static/admin
# COPY --from=build /app/create_llama/frontend/out /app/static
# COPY --from=build /app/admin/out /app/static/admin
COPY --from=build /app/create_llama/backend /app/create_llama/backend
COPY . .

Expand Down
32 changes: 7 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,29 @@
export PYTHONPATH := ${PYTHONPATH}:./create_llama/backend
export CREATE_LLAMA_VERSION=0.1.7
export CREATE_LLAMA_VERSION=0.1.18
export NEXT_PUBLIC_API_URL=/api/chat

create-llama-app:
@echo "\nCreating Llama App..."
rm -rf create_llama
npx -y create-llama@${CREATE_LLAMA_VERSION} \
--framework fastapi \
--template streaming \
--engine context \
--frontend \
--ui shadcn \
--observability none \
--open-ai-key none \
--tools none \
--post-install-action none \
--no-llama-parse \
--no-files \
--vector-db chroma \
-- create_llama
# We don't need the example data and default .env files
rm -rf create_llama/backend/data/*
rm -rf create_llama/backend/.env
rm -rf create_llama/frontend/.env
mkdir -p create_llama
cp -r ./create_llama_local/* create_llama/

patch-chat: create-llama-app
cp -r ./patch/* ./create_llama/

build-chat: patch-chat
@echo "\nBuilding Chat UI..."
cd ./create_llama/frontend && npm install && npm run build
cd ./create_llama/frontend && pnpm install && pnpm run build
@echo "\nCopying Chat UI to static folder..."
mkdir -p ./static && cp -r ./create_llama/frontend/out/* ./static/
@echo "\nDone!"

build-admin:
@echo "\nBuilding Admin UI..."
cd ./admin && npm install && npm run build
cd ./admin && pnpm install && pnpm run build
@echo "\nCopying Admin UI to static folder..."
mkdir -p ./static/admin && cp -r ./admin/out/* ./static/admin/
@echo "\nDone!"

build-frontends: build-chat build-admin
build-frontends: patch-chat

run:
poetry run python main.py
Expand All @@ -52,5 +34,5 @@ dev:
@export ENVIRONMENT=dev; \
trap 'kill 0' SIGINT; \
poetry run python main.py & \
npm run dev --prefix ./admin & \
pnpm --prefix ./admin run dev & \
wait
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Then, access the Admin UI at http://localhost:8000/admin to configure your RAGap

You can use hosted AI models from OpenAI or Gemini, and local models using [Ollama](https://ollama.com/).

> _Note_: To avoid [running into any errors](https://github.com/ragapp/ragapp/issues/22), we recommend using the latest version of Docker and (if needed) Docker Compose.

## Endpoints

The docker container exposes the following endpoints:
Expand All @@ -36,7 +38,17 @@ The docker container exposes the following endpoints:

> _Note_: The Chat UI and API are only functional if the RAGapp is configured.

RAGapp doesn't come with any authentication layer by design. Just protect the `/admin` path in your cloud environment to secure your RAGapp.
## Security

### Authentication

RAGapp doesn't come with any authentication layer by design. You'll have to protect the `/admin` and `/api/management` paths in your cloud environment to secure your RAGapp.
This step heavily depends on your cloud provider and the services you use.
A common way to do so using Kubernetes is to use an [Ingress Controller](https://kubernetes.github.io/ingress-nginx/examples/auth/basic/).

### Authorization

Later versions of RAGapp will support to restrict access based on access tokens forwarded from an API Gateway or similar.

## Deployment

Expand All @@ -54,6 +66,8 @@ If you don't specify the `MODEL` variable, the default model used is `phi3`, whi

> _Note_: The `setup` container in the `docker-compose.yml` file will download the selected model into the [`ollama`](./ollama/) folder - this will take a few minutes.

#### Specify the Ollama host

Using the `OLLAMA_BASE_URL` environment variables, you can specify which Ollama host to use.
If you don't specify the `OLLAMA_BASE_URL` variable, the default points to the Ollama instance started by Docker Compose (`http://ollama:11434`).

Expand All @@ -63,7 +77,13 @@ If you're running a local Ollama instance, you can choose to connect it to RAGap
MODEL=llama3 OLLAMA_BASE_URL=http://host.docker.internal:11434 docker-compose up
```

This is necessary if you're running RAGapp on macOS, as Docker for Mac does not support GPU acceleration.
> _Note_: `host.docker.internal` is not available on Linux machines, you'll have to use `172.17.0.1` instead. For details see [Issue #78](https://github.com/ragapp/ragapp/issues/78).

#### GPU acceleration

Using a local Ollama instance is necessary if you're running RAGapp on macOS, as Docker for Mac does not support GPU acceleration.

To enable Docker access to NVIDIA GPUs on Linux, [install the NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).

### Kubernetes

Expand All @@ -82,3 +102,7 @@ make dev
## Contact

Questions, feature requests or found a bug? [Open an issue](https://github.com/ragapp/ragapp/issues/new/choose) or reach out to [marcusschiesser](https://github.com/marcusschiesser).

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=ragapp/ragapp&type=Date)](https://star-history.com/#ragapp/ragapp&Date)
3 changes: 3 additions & 0 deletions admin/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pnpm-lock.yaml
lib/
dist/
34 changes: 34 additions & 0 deletions admin/client/chatConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { z } from "zod";
import { getBaseURL } from "./utils";

// Chat config scheme
export const ChatConfigSchema = z.object({
custom_prompt: z.string().optional(),
conversation_starters: z.array(z.string()),
});

export type ChatConfigFormType = z.TypeOf<typeof ChatConfigSchema>;

export async function getChatConfig(): Promise<ChatConfigFormType> {
const res = await fetch(`${getBaseURL()}/api/management/config/chat`);
if (!res.ok) {
throw new Error("Failed to fetch chat config");
}
return res.json();
}

export async function updateChatConfig(
data: ChatConfigFormType,
): Promise<ChatConfigFormType> {
const res = await fetch(`${getBaseURL()}/api/management/config/chat`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
if (!res.ok) {
throw new Error("Failed to update chat config");
}
return res.json();
}
Loading