Skip to content

feat(scripts): start-ollama-compat.ps1 convenience wrapper#31

Merged
sharpninja merged 1 commit intomainfrom
feat/start-ollama-script
Apr 23, 2026
Merged

feat(scripts): start-ollama-compat.ps1 convenience wrapper#31
sharpninja merged 1 commit intomainfrom
feat/start-ollama-script

Conversation

@sharpninja
Copy link
Copy Markdown
Owner

Summary

PowerShell helper that stops any real Ollama daemon and starts BitNetSharp's Ollama-compat server on the same port.

Steps:

  1. Stops Windows service Ollama if registered
  2. Kills any ollama* process (tray, daemon, GUI)
  3. Loops releasing port (default 11434) until free
  4. Launches dotnet run --project src/BitNetSharp.App -- serve in foreground

Ctrl+C cleanly stops the serve; real Ollama is NOT auto-restarted by design (user chose to swap).

Usage

pwsh scripts/start-ollama-compat.ps1 -Model data/models/bonsai.bitnetsharp.gguf
pwsh scripts/start-ollama-compat.ps1 -Model x.gguf -Port 11435 -BindHost 0.0.0.0 -NoCors

Defaults: Port 11434, BindHost 127.0.0.1, Configuration Release.

🤖 Generated with Claude Code

Stops any real Ollama daemon (service + tray + stray processes),
releases port 11434, then launches `dotnet run -- serve` with the
given model. Ctrl+C cleanly stops the serve; original Ollama is not
auto-restarted by design.

  pwsh scripts/start-ollama-compat.ps1 -Model data/models/x.gguf
  pwsh scripts/start-ollama-compat.ps1 -Model x.gguf -Port 11435 -BindHost 0.0.0.0

Params: -Model (required), -Port, -BindHost, -Configuration, -NoCors.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61132d1534

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to +53
Write-Section 'Stopping Ollama service (if present)'
$svc = Get-Service -Name 'Ollama' -ErrorAction SilentlyContinue
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate repo before stopping local Ollama

The script begins shutting down the Ollama service/processes before confirming the current directory is a valid BitNetSharp checkout. In the wrong-directory or broken-checkout case, this kills the user's running Ollama daemon and only then throws at the later repo check, so the command fails without starting the replacement server. Please run the repo/project sanity check first so precondition failures are non-destructive.

Useful? React with 👍 / 👎.

@sharpninja sharpninja merged commit 838c044 into main Apr 23, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant