diff --git a/.github/workflows/auto-assign-milestone.yml b/.github/workflows/auto-assign-milestone.yml index bdcfafb8b..03f72973d 100644 --- a/.github/workflows/auto-assign-milestone.yml +++ b/.github/workflows/auto-assign-milestone.yml @@ -7,6 +7,7 @@ on: jobs: assign_milestone: runs-on: ubuntu-latest + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} permissions: pull-requests: write issues: write diff --git a/.github/workflows/autoqa-migration.yml b/.github/workflows/autoqa-migration.yml new file mode 100644 index 000000000..86a6a40ca --- /dev/null +++ b/.github/workflows/autoqa-migration.yml @@ -0,0 +1,330 @@ +name: AutoQA Migration (Manual) + +on: + workflow_dispatch: + inputs: + old_windows_installer: + description: 'Windows OLD installer URL or path (.exe)' + required: true + type: string + new_windows_installer: + description: 'Windows NEW installer URL or path (.exe)' + required: true + type: string + old_ubuntu_installer: + description: 'Ubuntu OLD installer URL or path (.deb)' + required: false + type: string + default: '' + new_ubuntu_installer: + description: 'Ubuntu NEW installer URL or path (.deb)' + required: false + type: string + default: '' + old_macos_installer: + description: 'macOS OLD installer URL or path (.dmg)' + required: false + type: string + default: '' + new_macos_installer: + description: 'macOS NEW installer URL or path (.dmg)' + required: false + type: string + default: '' + migration_test_case: + description: 'Specific migration test case key (leave empty to run all)' + required: false + type: string + default: '' + max_turns: + description: 'Maximum turns per test phase' + required: false + type: number + default: 65 + +jobs: + migration-windows: + runs-on: windows-11-nvidia-gpu + timeout-minutes: 60 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python 3.13 + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: Clean existing Jan installations + shell: powershell + run: | + .\autoqa\scripts\windows_cleanup.ps1 -IsNightly $false + + - name: Download OLD and NEW installers + shell: powershell + run: | + # Download OLD installer using existing script + .\autoqa\scripts\windows_download.ps1 ` + -WorkflowInputUrl "${{ inputs.old_windows_installer }}" ` + -WorkflowInputIsNightly "false" ` + -RepoVariableUrl "" ` + -RepoVariableIsNightly "" ` + -DefaultUrl "" ` + -DefaultIsNightly "" + + $oldSrc = Join-Path $env:TEMP 'jan-installer.exe' + $oldOut = Join-Path $env:TEMP 'jan-old.exe' + Copy-Item -Path $oldSrc -Destination $oldOut -Force + + # Download NEW installer using existing script + .\autoqa\scripts\windows_download.ps1 ` + -WorkflowInputUrl "${{ inputs.new_windows_installer }}" ` + -WorkflowInputIsNightly "false" ` + -RepoVariableUrl "" ` + -RepoVariableIsNightly "" ` + -DefaultUrl "" ` + -DefaultIsNightly "" + + $newSrc = Join-Path $env:TEMP 'jan-installer.exe' + $newOut = Join-Path $env:TEMP 'jan-new.exe' + Copy-Item -Path $newSrc -Destination $newOut -Force + + Write-Host "OLD installer: $oldOut" + Write-Host "NEW installer: $newOut" + echo "OLD_VERSION=$oldOut" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "NEW_VERSION=$newOut" | Out-File -FilePath $env:GITHUB_ENV -Append + + - name: Install Python dependencies + working-directory: autoqa + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run migration tests (Windows) + working-directory: autoqa + shell: powershell + env: + RP_TOKEN: ${{ secrets.RP_TOKEN }} + ENABLE_REPORTPORTAL: 'true' + RP_ENDPOINT: 'https://reportportal.menlo.ai' + RP_PROJECT: 'default_personal' + run: | + $case = "${{ inputs.migration_test_case }}" + $caseArg = "" + if ($case -and $case.Trim() -ne "") { $caseArg = "--migration-test-case `"$case`"" } + python main.py --enable-migration-test --old-version "$env:OLD_VERSION" --new-version "$env:NEW_VERSION" --max-turns ${{ inputs.max_turns }} $caseArg + + - name: Upload screen recordings + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: migration-recordings-${{ github.run_number }}-windows + path: autoqa/recordings/ + + - name: Upload trajectories + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: migration-trajectories-${{ github.run_number }}-windows + path: autoqa/trajectories/ + + - name: Cleanup after tests + if: always() + shell: powershell + run: | + .\autoqa\scripts\windows_post_cleanup.ps1 -IsNightly $false + + migration-ubuntu: + if: inputs.old_ubuntu_installer != '' && inputs.new_ubuntu_installer != '' + runs-on: ubuntu-22-04-nvidia-gpu + timeout-minutes: 60 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python 3.13 + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + x11-utils \ + python3-tk \ + python3-dev \ + wmctrl \ + xdotool \ + libnss3-dev \ + libgconf-2-4 \ + libxss1 \ + libasound2 \ + libxtst6 \ + libgtk-3-0 \ + libgbm-dev \ + libxshmfence1 \ + libxrandr2 \ + libpangocairo-1.0-0 \ + libatk1.0-0 \ + libcairo-gobject2 \ + libgdk-pixbuf2.0-0 \ + gnome-screenshot \ + xvfb + + - name: Setup script permissions + run: | + chmod +x autoqa/scripts/setup_permissions.sh || true + ./autoqa/scripts/setup_permissions.sh || true + + - name: Clean existing Jan installations + run: | + ./autoqa/scripts/ubuntu_cleanup.sh + + - name: Download OLD and NEW installers + run: | + set -e + # Download OLD installer using existing script + ./autoqa/scripts/ubuntu_download.sh \ + "${{ inputs.old_ubuntu_installer }}" \ + "false" \ + "" \ + "" \ + "" \ + "" + cp /tmp/jan-installer.deb /tmp/jan-old.deb + + # Download NEW installer using existing script + ./autoqa/scripts/ubuntu_download.sh \ + "${{ inputs.new_ubuntu_installer }}" \ + "false" \ + "" \ + "" \ + "" \ + "" + cp /tmp/jan-installer.deb /tmp/jan-new.deb + + echo "OLD_VERSION=/tmp/jan-old.deb" >> $GITHUB_ENV + echo "NEW_VERSION=/tmp/jan-new.deb" >> $GITHUB_ENV + + - name: Install Python dependencies + working-directory: autoqa + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run migration tests (Ubuntu) + working-directory: autoqa + run: | + case="${{ inputs.migration_test_case }}" + caseArg="" + if [ -n "${case}" ]; then caseArg="--migration-test-case \"${case}\""; fi + xvfb-run -a python main.py --enable-migration-test --old-version "${OLD_VERSION}" --new-version "${NEW_VERSION}" --max-turns ${{ inputs.max_turns }} ${caseArg} + + - name: Upload screen recordings + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: migration-recordings-${{ github.run_number }}-ubuntu + path: autoqa/recordings/ + + - name: Upload trajectories + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: migration-trajectories-${{ github.run_number }}-ubuntu + path: autoqa/trajectories/ + + - name: Cleanup after tests + if: always() + run: | + ./autoqa/scripts/ubuntu_post_cleanup.sh "false" + + migration-macos: + if: inputs.old_macos_installer != '' && inputs.new_macos_installer != '' + runs-on: macos-selfhosted-15-arm64-cua + timeout-minutes: 60 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python 3.13 + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: Setup script permissions + run: | + chmod +x autoqa/scripts/setup_permissions.sh || true + ./autoqa/scripts/setup_permissions.sh || true + + - name: Clean existing Jan installations + run: | + ./autoqa/scripts/macos_cleanup.sh + + - name: Download OLD and NEW installers + run: | + set -e + # Download OLD installer using existing script + ./autoqa/scripts/macos_download.sh \ + "${{ inputs.old_macos_installer }}" \ + "false" \ + "" \ + "" \ + "" \ + "" + cp /tmp/jan-installer.dmg /tmp/jan-old.dmg + + # Download NEW installer using existing script + ./autoqa/scripts/macos_download.sh \ + "${{ inputs.new_macos_installer }}" \ + "false" \ + "" \ + "" \ + "" \ + "" + cp /tmp/jan-installer.dmg /tmp/jan-new.dmg + + echo "OLD_VERSION=/tmp/jan-old.dmg" >> $GITHUB_ENV + echo "NEW_VERSION=/tmp/jan-new.dmg" >> $GITHUB_ENV + + - name: Install Python dependencies + working-directory: autoqa + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run migration tests (macOS) + working-directory: autoqa + run: | + case="${{ inputs.migration_test_case }}" + caseArg="" + if [ -n "${case}" ]; then caseArg="--migration-test-case \"${case}\""; fi + python main.py --enable-migration-test --old-version "${OLD_VERSION}" --new-version "${NEW_VERSION}" --max-turns ${{ inputs.max_turns }} ${caseArg} + + - name: Upload screen recordings + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: migration-recordings-${{ github.run_number }}-macos + path: autoqa/recordings/ + + - name: Upload trajectories + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: migration-trajectories-${{ github.run_number }}-macos + path: autoqa/trajectories/ + + - name: Cleanup after tests + if: always() + run: | + ./autoqa/scripts/macos_post_cleanup.sh + + diff --git a/Makefile b/Makefile index 4bd823437..2515f8bf4 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,8 @@ test: lint yarn copy:assets:tauri yarn build:icon cargo test --manifest-path src-tauri/Cargo.toml --no-default-features --features test-tauri -- --test-threads=1 + cargo test --manifest-path src-tauri/plugins/tauri-plugin-hardware/Cargo.toml + cargo test --manifest-path src-tauri/plugins/tauri-plugin-llamacpp/Cargo.toml # Builds and publishes the app build-and-publish: install-and-build diff --git a/core/src/browser/extensions/engines/AIEngine.ts b/core/src/browser/extensions/engines/AIEngine.ts index b203092ce..7a223e468 100644 --- a/core/src/browser/extensions/engines/AIEngine.ts +++ b/core/src/browser/extensions/engines/AIEngine.ts @@ -194,6 +194,10 @@ export interface chatOptions { export interface ImportOptions { modelPath: string mmprojPath?: string + modelSha256?: string + modelSize?: number + mmprojSha256?: string + mmprojSize?: number } export interface importResult { diff --git a/core/src/types/api/index.ts b/core/src/types/api/index.ts index ade6421ff..d40aab852 100644 --- a/core/src/types/api/index.ts +++ b/core/src/types/api/index.ts @@ -73,6 +73,9 @@ export enum DownloadEvent { onFileDownloadSuccess = 'onFileDownloadSuccess', onFileDownloadStopped = 'onFileDownloadStopped', onFileDownloadStarted = 'onFileDownloadStarted', + onModelValidationStarted = 'onModelValidationStarted', + onModelValidationFailed = 'onModelValidationFailed', + onFileDownloadAndVerificationSuccess = 'onFileDownloadAndVerificationSuccess', } export enum ExtensionRoute { baseExtensions = 'baseExtensions', diff --git a/docs/public/assets/images/general/og-jan-research.jpeg b/docs/public/assets/images/general/og-jan-research.jpeg new file mode 100644 index 000000000..93abef112 Binary files /dev/null and b/docs/public/assets/images/general/og-jan-research.jpeg differ diff --git a/docs/src/pages/post/_assets/deep_research_compare_jan.gif b/docs/src/pages/post/_assets/deep_research_compare_jan.gif new file mode 100644 index 000000000..bebc0db31 Binary files /dev/null and b/docs/src/pages/post/_assets/deep_research_compare_jan.gif differ diff --git a/docs/src/pages/post/_assets/jan-research.jpeg b/docs/src/pages/post/_assets/jan-research.jpeg new file mode 100644 index 000000000..93abef112 Binary files /dev/null and b/docs/src/pages/post/_assets/jan-research.jpeg differ diff --git a/docs/src/pages/post/_assets/jan_default_prompt.png b/docs/src/pages/post/_assets/jan_default_prompt.png new file mode 100644 index 000000000..293f20f26 Binary files /dev/null and b/docs/src/pages/post/_assets/jan_default_prompt.png differ diff --git a/docs/src/pages/post/_assets/jan_open_prompt_template.png b/docs/src/pages/post/_assets/jan_open_prompt_template.png new file mode 100644 index 000000000..fc1c3e489 Binary files /dev/null and b/docs/src/pages/post/_assets/jan_open_prompt_template.png differ diff --git a/docs/src/pages/post/_assets/jan_prompt_template_settings.png b/docs/src/pages/post/_assets/jan_prompt_template_settings.png new file mode 100644 index 000000000..47039274a Binary files /dev/null and b/docs/src/pages/post/_assets/jan_prompt_template_settings.png differ diff --git a/docs/src/pages/post/_assets/jan_research_prompt.png b/docs/src/pages/post/_assets/jan_research_prompt.png new file mode 100644 index 000000000..0d053b90e Binary files /dev/null and b/docs/src/pages/post/_assets/jan_research_prompt.png differ diff --git a/docs/src/pages/post/_assets/jan_settings.png b/docs/src/pages/post/_assets/jan_settings.png new file mode 100644 index 000000000..ede9a3143 Binary files /dev/null and b/docs/src/pages/post/_assets/jan_settings.png differ diff --git a/docs/src/pages/post/jan-v1-for-research.mdx b/docs/src/pages/post/jan-v1-for-research.mdx new file mode 100644 index 000000000..b23f17d2f --- /dev/null +++ b/docs/src/pages/post/jan-v1-for-research.mdx @@ -0,0 +1,446 @@ +--- +title: "Jan v1 for Deep Research: System Prompts & Setup Guide" +description: "Explore Jan-V1 capabilities in report generation and research tasks with prompt comparisons, examples, and customization instructions." +keywords: ["Jan-V1", "AI research", "system prompts", "LLM optimization", "research AI", "Jan App", "model configuration"] +readingTime: "8 min read" +tags: Qwen, Jan-V1, Agentic +categories: research +ogImage: assets/images/general/og-jan-research.jpeg +date: 2025-08-22 +--- + +# Jan v1 for Deep Research: System Prompts & Setup Guide + +This cookbook will transform your Jan-V1 from a basic Q&A tool into a comprehensive research assistant. By the end of this guide, you'll have a custom-configured model that generates detailed reports with proper citations instead of surface-level answers. + + + +## Key Points + +- **Jan-V1 includes a default chat template** that's automatically embedded in its Hugging Face configuration +- **Use the default prompt** for daily tasks requiring short, accurate answers +- **Use the research prompt** for report generation and comprehensive research tasks +- **Always specify dates** when asking time-sensitive questions (e.g., "What's the world population in 2023?") + +--- + +## Introduction + +[Jan-V1](https://huggingface.co/janhq/Jan-v1-4B) is the first release in the **Jan Family**, designed for agentic reasoning and problem-solving within the [Jan App](https://jan.ai/). Based on our [**Lucy**](https://huggingface.co/Menlo/Lucy) model, Jan-v1 achieves improved performance through model scaling. + +Jan-v1 uses the [Qwen3-4B-thinking](https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507) model to provide enhanced reasoning capabilities and tool utilization. This architecture delivers better performance on complex agentic tasks. + +This guide explores how to optimize Jan-V1 for research-intensive tasks by switching from the default prompt to a specialized research system prompt. Through our internal testing, we've found significant improvements in report generation quality, depth of analysis, and citation accuracy when using the research-optimized system prompt. + + +## Findings + +Jan-V1 comes with a built-in search and scrape prompt in its default template. This prompt is optimized for SimpleQA-style questions and daily tasks that require short, accurate responses. However, our testing revealed that when tasked with generating comprehensive long-form reports or conducting in-depth research, the model's performance was inconsistent with the default prompt. + +We experimented with Jan-V1 using a new system prompt optimized for research-intensive tasks and found significant improvements in report generation capability. The research prompt produces more comprehensive, well-structured reports with proper citations and deeper analysis compared to the default prompt. + +--- + +## Output comparison between Default System Prompt and Research Prompt on report generation task + +### Example 1: Long-Context Benchmark Comparison + +**User Request:** +> Compare all published benchmarks for long-context performance across LLMs released in 2024-2025 + + +
{t('vision')}
-+ {isVariantMode + ? 'Model Variant Information' + : 'Model Information'} +
+{getStatusTooltip()}
+{t('tools')}
-{t('vision')}
-{t('vision')}
+{t('tools')}
+{t('vision')}
+{t('tools')}
+{variant.file_size}
+