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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.targets text eol=crlf
*.xaml text eol=crlf
*.xml text eol=crlf
*.ps1 text eol=crlf
*.md text eol=lf
*.json text eol=lf
*.yml text eol=lf
Expand Down
34 changes: 34 additions & 0 deletions .github/releases/v0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# TextRecast v0.2.0

TextRecast 0.2.0 adds explicit, user-controlled local model selection.

## Highlights

- Shows four local model choices before any download begins.
- Displays role, English-only status, download size, hardware compatibility, and known limitations.
- Downloads only the exact model the user confirms.
- Reuses a valid installed selection on later launches.
- Keeps resumable downloads and exact size and SHA-256 verification.
- Uses model-specific prompt and sampling profiles for Qwen 2.5, Qwen 3.5, and Granite 4.1.
- Keeps the active model and its limitation note available from the launcher menu.

## Included choices

| Role | Model | Download | Status |
| --- | --- | ---: | --- |
| Fast/default | Qwen 2.5 1.5B Q4_K_M | 1.04 GiB | Established default |
| Balanced | Qwen 3.5 2B Q5_K_M | 1.34 GiB | Experimental |
| Best quality | Qwen 3.5 4B Q5_K_M | 2.93 GiB | Experimental |
| Alternative | Granite 4.1 3B Q5_K_M | 2.27 GiB | Experimental |

All four choices are currently supported for English rewriting only. Local models can change meaning or details; review the replaced text in the source application after every operation. The setup screen describes the specific risks observed for each experimental model.

## Install

1. Download `TextRecast-v0.2.0-win-x64.zip` and its `.zip.sha256` file.
2. Verify the checksum if desired, then extract the complete ZIP.
3. Run `TextRecast.exe` and confirm one compatible model during setup.

The application is self-contained, so .NET 10 does not need to be installed. The Microsoft Visual C++ x64 Redistributable may still be required. The release ZIP contains no GGUF model and includes the legal notices supplied with its bundled .NET runtime packs.

Existing valid Qwen 2.5 installations are detected and can be reused after confirmation without downloading the model again.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ jobs:
"TextRecast.exe",
"LICENSE",
"NOTICE",
"THIRD-PARTY-NOTICES.md"
"THIRD-PARTY-NOTICES.md",
"DOTNET-LICENSE.txt",
"DOTNET-THIRD-PARTY-NOTICES.txt",
"WPF-LICENSE.txt"
)
foreach ($file in $requiredFiles) {
if (-not (Test-Path -LiteralPath (Join-Path $publishDirectory $file) -PathType Leaf)) {
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.1.1</Version>
<Version>0.2.0</Version>
<Copyright>Copyright 2026 snss10</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
54 changes: 35 additions & 19 deletions Models/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
# Default local SLM
# Supported local models

TextRecast currently uses the following default model profile:
TextRecast runs one cataloged GGUF model at a time. During setup, the user reviews the available choices and confirms the exact model before any download starts. Release archives do not contain model binaries.

| Property | Value |
| --- | --- |
| Model | `Qwen2.5-1.5B-Instruct-GGUF` |
| File | `qwen2.5-1.5b-instruct-q4_k_m.gguf` |
| Quantization | `Q4_K_M` |
| Size | `1,117,320,736` bytes |
| SHA-256 | `6a1a2eb6d15622bf3c96857206351ba97e1af16c30d7a74ee38970e434e9407e` |
| Source | [Qwen/Qwen2.5-1.5B-Instruct-GGUF](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF) |
| License | Apache License 2.0 |
All current profiles are for English rewriting. The three newer choices are experimental, and every replacement should be reviewed in the source application.

The model binary is intentionally ignored by Git. When no packaged model is present, TextRecast downloads and verifies it automatically, then stores it at:
| Role | Model file | Size | SHA-256 |
| --- | --- | ---: | --- |
| Fast/default | `qwen2.5-1.5b-instruct-q4_k_m.gguf` | 1,117,320,736 bytes | `6a1a2eb6d15622bf3c96857206351ba97e1af16c30d7a74ee38970e434e9407e` |
| Balanced | `Qwen3.5-2B-Q5_K_M.gguf` | 1,435,238,656 bytes | `1885b3a9195f8cc09da9a7a7a75afdc1e8d5cbf9fc4a499c3961dddea37098ac` |
| Best quality | `Qwen3.5-4B-Q5_K_M.gguf` | 3,143,656,608 bytes | `8814232b85594dcd46c50e5b8b29324a7efe9e746edbe8a3d1df3d3fce7aad39` |
| Alternative | `granite-4.1-3b-Q5_K_M.gguf` | 2,437,012,064 bytes | `f7724d259f29b0edf147144ac530ca26f91c97af8274249f933073c461678a3c` |

## Pinned sources

| Model | Repository and revision | License |
| --- | --- | --- |
| Qwen 2.5 1.5B Q4_K_M | [`Qwen/Qwen2.5-1.5B-Instruct-GGUF@dd26da4`](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF/tree/dd26da440ef0330c47919d1ecae0966d24022222) | Apache-2.0 |
| Qwen 3.5 2B Q5_K_M | [`unsloth/Qwen3.5-2B-GGUF@f6d5376`](https://huggingface.co/unsloth/Qwen3.5-2B-GGUF/tree/f6d5376be1edb4d416d56da11e5397a961aca8ae) | Apache-2.0 |
| Qwen 3.5 4B Q5_K_M | [`unsloth/Qwen3.5-4B-GGUF@e87f176`](https://huggingface.co/unsloth/Qwen3.5-4B-GGUF/tree/e87f176479d0855a907a41277aca2f8ee7a09523) | Apache-2.0 |
| Granite 4.1 3B Q5_K_M | [`ibm-granite/granite-4.1-3b-GGUF@ab47014`](https://huggingface.co/ibm-granite/granite-4.1-3b-GGUF/tree/ab4701481089b58a082ef63cc1cee738887293ff) | Apache-2.0 |

The model binaries remain subject to their upstream terms and are not relicensed as part of TextRecast. Review the linked model cards and licenses before redistributing any binary.

## Storage and verified downloads

Downloaded models are stored for the current Windows user under:

```text
%LOCALAPPDATA%\TextRecast\Models\qwen2.5-1.5b-instruct-q4_k_m.gguf
%LOCALAPPDATA%\TextRecast\Models
```

Interrupted downloads use stable files beside the final model:
An interrupted download uses two temporary files beside its final destination:

```text
qwen2.5-1.5b-instruct-q4_k_m.gguf.partial
qwen2.5-1.5b-instruct-q4_k_m.gguf.partial.metadata.json
<model-file>.partial
<model-file>.partial.metadata.json
```

TextRecast sends HTTP Range and If-Range requests to continue a valid partial download. It restarts when the server ignores the range, reports a mismatched range, or exposes a changed validator. Temporary HTTP failures are retried with bounded backoff. The final file is moved into place only after its exact size and SHA-256 checksum are verified; untrusted partial data is removed.
TextRecast uses HTTP Range and If-Range to resume compatible partial downloads. It restarts when the server ignores the range, returns inconsistent metadata, or exposes a changed validator. The final file is installed only after its exact size and SHA-256 pass verification.

## Offline or portable builds

Place only exact cataloged GGUF files in this directory before publishing. The App project links `Models/*.gguf` into its output, and setup marks matching files as installed. Do not rename a model file or substitute another quantization without adding and testing a separate catalog profile.

For an offline or portable build, place the GGUF file in this repository directory before publishing. The App project links matching `Models/*.gguf` files into its output.
The normal GitHub Actions release intentionally fails if a GGUF file enters the self-contained ZIP. This keeps the public application download small and leaves the model choice with the user.

The default metadata is defined in [`SlmModelCatalog.cs`](../src/TextRecast.Infrastructure/SLM/SlmModelCatalog.cs). Add future model profiles there and review each upstream model card and license before distribution.
Catalog metadata is defined in [`SlmModelCatalog.cs`](../src/TextRecast.Infrastructure/SLM/SlmModelCatalog.cs).
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

TextRecast is a lightweight Windows desktop utility that rewrites text inside the applications you already use. Select editable text, click the floating TextRecast button, choose an operation, and apply the result back to the original selection.

Inference runs locally through LLamaSharp's CPU backend. The default model is Qwen2.5-1.5B-Instruct, and the SLM layer is designed so additional local models can be added later.
Inference runs locally through LLamaSharp's CPU backend. On first setup, TextRecast presents four cataloged models and downloads only the option the user explicitly confirms. Qwen 2.5 1.5B remains the fast default; the other choices are clearly labeled experimental.

## Features

Expand All @@ -34,6 +34,7 @@ Inference runs locally through LLamaSharp's CPU backend. The default model is Qw
- Change tone to Professional, Casual, Friendly, Formal, or Direct
- Work in browsers, editors, messaging apps, and other Windows applications
- Run formatting locally without an account or API key
- Choose a compatible local model before any download begins
- Resume an interrupted model download instead of starting over
- Cancel an active generation and retry a failed replacement
- Revalidate the source window and selected text before replacing anything
Expand All @@ -42,16 +43,16 @@ Inference runs locally through LLamaSharp's CPU backend. The default model is Qw

### Requirements

- Windows 10 or Windows 11 on x64 hardware
- Windows 11 on x64 hardware, or a [Windows 10 edition still supported by .NET 10](https://github.com/dotnet/core/blob/main/release-notes/10.0/supported-os.md)
- The current [Microsoft Visual C++ v14 Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) for x64
- Approximately 1.5 GB of available disk space
- Approximately 2-4 GB of available disk space, depending on the selected model
- An internet connection when no valid packaged or previously installed model is available

The published Windows x64 application is self-contained. Users running that build do **not** need to install .NET 10.

### Run a published build

1. Download `TextRecast-v0.1.1-win-x64.zip` from the [Releases page](https://github.com/snss10/TextRecast/releases).
1. Download the latest `TextRecast-vX.Y.Z-win-x64.zip` from the [Releases page](https://github.com/snss10/TextRecast/releases).
2. Optionally verify it with the accompanying `.zip.sha256` file.
3. Extract the entire archive to a folder.
4. Run `TextRecast.exe`.
Expand All @@ -60,9 +61,18 @@ Keep every file from the archive together; the application depends on the includ

## First launch and model download

When no valid packaged or previously installed model is available, TextRecast downloads the 1.1 GB Qwen model on first launch. The setup window shows transferred size, speed, estimated time remaining, verification, and installation status.
TextRecast shows the available models before making a network request. Each choice includes its role, download size, hardware compatibility, language support, and known limitations. The exact model and size are shown again for confirmation; only that model is downloaded.

Cancelling or losing the connection keeps a validated partial download. Select **Retry** on the same computer to continue from the saved point. TextRecast restarts safely if the server no longer accepts the saved range or the remote file has changed. A model becomes active only after its exact size and SHA-256 checksum pass verification.
| Role | Model | Download | Status |
| --- | --- | ---: | --- |
| Fast/default | Qwen 2.5 1.5B Q4_K_M | 1.04 GiB | Established default; review all output |
| Balanced | Qwen 3.5 2B Q5_K_M | 1.34 GiB | Experimental; summaries need extra review |
| Best quality | Qwen 3.5 4B Q5_K_M | 2.93 GiB | Experimental; verify roles, titles, and deadlines |
| Alternative | Granite 4.1 3B Q5_K_M | 2.27 GiB | Experimental; higher semantic-drift risk |

These profiles are currently supported for English rewriting only. None is perfect, so review the replaced text in the source application after every operation. Hardware recommendations are guidance; Qwen 2.5 remains selectable when hardware inspection is unavailable.

Cancelling or losing the connection keeps a validated partial download. Select **Retry** on the same computer to continue from the saved point. TextRecast restarts safely if the server no longer accepts the saved range or the remote file has changed. A model becomes active only after its exact size and SHA-256 checksum pass verification. A valid installed selection is reused on later launches.

The first formatting request loads the model into memory. Later requests reuse the loaded model and usually start faster.

Expand All @@ -77,7 +87,7 @@ TextRecast stores the model for the current Windows user under:

`%LOCALAPPDATA%` is a standard Windows environment variable. It expands automatically to the signed-in user's local application-data folder; it is not a path tied to the developer's computer.

For the exact filename, checksum, upstream source, and offline setup instructions, see [Models/README.md](Models/README.md).
For exact filenames, checksums, pinned upstream revisions, and offline setup instructions, see [Models/README.md](Models/README.md).
</details>

<details>
Expand All @@ -102,7 +112,7 @@ There are no author-specific absolute paths in this README.

TextRecast returns focus to the source application, confirms that the original selection is still valid, and then replaces it. If replacement cannot be completed safely, the original text remains unchanged and the generated result remains available for **Retry replace**.

Drag the floating icon to reposition it. Right-click the icon and choose **Quit TextRecast** to close the application.
Drag the floating icon to reposition it. Right-click it to view the active model and its limitations, or choose **Quit TextRecast** to close the application.

## Privacy and safeguards

Expand All @@ -116,7 +126,7 @@ Drag the floating icon to reposition it. Right-click the icon and choose **Quit

Capture fallback and replacement temporarily use the Windows clipboard. Windows clipboard history, clipboard sync, or third-party clipboard managers may retain that content, so disable those features when working with sensitive text.

Network access is used to obtain the model only when a valid model is not already packaged or installed. After that download, normal formatting does not require a cloud service.
Network access begins only after the user confirms a model that is not already packaged or installed. After that download, normal formatting does not require a cloud service.

## How it works

Expand Down Expand Up @@ -154,7 +164,7 @@ Install the latest x64 package from Microsoft's [supported Visual C++ Redistribu
<details>
<summary><strong>The model download or integrity check failed</strong></summary>

Check the internet connection and available disk space, then retry. TextRecast keeps a safe partial download after cancellation or a temporary network failure and resumes it automatically. Invalid partial data is discarded instead of being installed. Offline setup details and the expected checksum are in [Models/README.md](Models/README.md).
Check the internet connection and available disk space, then retry. TextRecast keeps a safe partial download after cancellation or a temporary network failure and resumes it automatically. Invalid partial data is discarded instead of being installed. Offline setup details and expected checksums are in [Models/README.md](Models/README.md).
</details>

<details>
Expand Down Expand Up @@ -192,17 +202,17 @@ dotnet run --project src/TextRecast.App/TextRecast.App.csproj
dotnet publish src/TextRecast.App/TextRecast.App.csproj -c Release -r win-x64 --self-contained true -o artifacts/TextRecast-win-x64
```

Distribute the complete output folder, not only the executable. The exact cataloged GGUF file documented in [Models/README.md](Models/README.md) is packaged when it is placed in the repository's `Models` directory before publishing; otherwise TextRecast downloads the model for the current user on first launch.
Distribute the complete output folder, not only the executable. Any cataloged GGUF files documented in [Models/README.md](Models/README.md) are packaged when placed in the repository's `Models` directory before publishing. Normal release packages intentionally contain no model; the user chooses and confirms one during setup.

For tagged releases, GitHub Actions creates a model-free `TextRecast-vX.Y.Z-win-x64.zip` containing the complete runtime and legal notices, plus a matching SHA-256 file. A release tag must use `vMAJOR.MINOR.PATCH` and match the version in `Directory.Build.props`.
For tagged releases, GitHub Actions creates a model-free `TextRecast-vX.Y.Z-win-x64.zip` containing the complete runtime, TextRecast legal files, and the legal files supplied with the bundled .NET runtime packs, plus a matching SHA-256 file. A release tag must use `vMAJOR.MINOR.PATCH` and match the version in `Directory.Build.props`.

## Project layout

- [TextRecast.App](src/TextRecast.App/) contains the WPF presentation layer and application composition.
- [TextRecast.Core](src/TextRecast.Core/) contains platform-independent workflows, contracts, results, and models.
- [TextRecast.Infrastructure](src/TextRecast.Infrastructure/) contains local SLM inference and Windows integrations.
- [tests](tests/) contains Core and Infrastructure automated tests.
- [Models](Models/) documents the default model and offline packaging.
- [Models](Models/) documents supported models, integrity metadata, and offline packaging.

```text
TextRecast.App ---------> TextRecast.Core
Expand All @@ -218,7 +228,7 @@ Model profiles are defined in [SlmModelCatalog.cs](src/TextRecast.Infrastructure

- WPF on .NET 10
- [LLamaSharp](https://github.com/SciSharp/LLamaSharp) with CPU inference
- [Qwen2.5-1.5B-Instruct-GGUF](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF)
- [Qwen 2.5 GGUF](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF), [Qwen 3.5 GGUF](https://huggingface.co/unsloth/Qwen3.5-2B-GGUF), and [Granite 4.1 GGUF](https://huggingface.co/ibm-granite/granite-4.1-3b-GGUF)
- Windows UI Automation, clipboard, and input APIs

## Security and license
Expand Down
Loading
Loading