GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Add local LLM improvements for reasoning models and Docker startup by csfet9 · Pull Request #88 · vectorize-io/hindsight

Conversation

@csfet9

@csfet9 csfet9 commented Jan 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

  • Reasoning model support: Strip thinking tags from local LLM responses, enabling Qwen3, DeepSeek, and other reasoning models
  • Docker retry-start script: Wait for dependencies (LLM Studio, database) before starting Hindsight

Changes

Reasoning Model Support (llm_wrapper.py)

Strips thinking tags from local LLM responses:

  • <think>...</think>
  • <thinking>...</thinking>
  • <reasoning>...</reasoning>
  • |startthink|...|endthink|

This enables reasoning models like Qwen3 to work with Hindsight's JSON extraction pipeline. Non-breaking change - only affects responses that contain these tags.

Docker Retry Start Script (retry-start.sh)

New startup script that waits for dependencies:

  • Checks LLM Studio at /v1/models endpoint
  • Checks database connectivity (skipped for embedded pg0)
  • Configurable retries via HINDSIGHT_RETRY_MAX (default: infinite)
  • Configurable interval via HINDSIGHT_RETRY_INTERVAL (default: 10s)

Prevents startup failures when LLM Studio takes time to load models.

Test plan

  • Tested reasoning model support with Qwen3 8B on LM Studio
  • Verified thinking tags are stripped correctly
  • Tested retry-start with LLM Studio dependency
  • Verified embedded pg0 detection works
  • Health endpoint returns healthy after startup

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@csfet9
feat: Add local LLM improvements for reasoning models and Docker startup
9f69794
## Reasoning Model Support
- Strip thinking tags from local LLM responses (<think>, <thinking>, <reasoning>, |startthink|/|endthink|)
- Enables Qwen3, DeepSeek, and other reasoning models to work with JSON extraction
- Non-breaking: only affects responses that contain thinking tags

## Docker Retry Start Script
- New retry-start.sh waits for dependencies before starting Hindsight
- Checks LLM Studio availability at /v1/models endpoint
- Checks database connectivity (skipped for embedded pg0)
- Configurable via HINDSIGHT_RETRY_MAX and HINDSIGHT_RETRY_INTERVAL env vars
- Prevents startup failures when LLM Studio isn't ready yet

Tested on Apple Silicon M4 Max with Qwen3 8B via LM Studio.
nicoloboschi
nicoloboschi requested changes Jan 2, 2026
View reviewed changes
Comment thread docker/standalone/retry-start.sh Outdated
@@ -0,0 +1,78 @@
#!/bin/bash
# Retry wrapper - waits for dependencies before starting hindsight

@nicoloboschi nicoloboschi Jan 2, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

can you modify the existing file start-all (instead of creating a new one) and indicate what is the problem you are trying to solve?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread hindsight-api/hindsight_api/engine/llm_wrapper.py
# Strip reasoning model thinking tags (various formats)
# Supports: <think>, <thinking>, <reasoning>, |startthink|/|endthink|
if content:
original_len = len(content)

@nicoloboschi nicoloboschi Jan 2, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

can we use the flag in the llm call to not include thinking tokens in the output? this way the user will not pay for those output tokens and we don't have to leverage on this heuristic and problematic algorithm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
csfet9 and others added 4 commits January 3, 2026 01:45
@csfet9
refactor: make thinking token stripping opt-in via env var
e65a645
@csfet9
refactor: merge retry logic into start-all.sh (opt-in via HINDSIGHT_W…
4cc8e2a
…AIT_FOR_DEPS)
@csfet9
Merge main into feature/local-llm-improvements
c7eee98
@csfet9 @claude
fix: resolve pg0 stale instance config in Docker build
f5248d8
- Remove stale pg0 instance data after pre-caching binaries to avoid
  port conflicts (was using hardcoded port 5555 from build time)
- Remove unused cache copy logic from start-all.sh
- Add database backup instructions to CLAUDE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
nicoloboschi
nicoloboschi approved these changes Jan 5, 2026
View reviewed changes
@nicoloboschi
nicoloboschi merged commit eea0f27 into vectorize-io:main Jan 5, 2026
@salmanmkc salmanmkc mentioned this pull request Mar 13, 2026
Upgrade GitHub Actions to latest versions #553
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nicoloboschi nicoloboschi nicoloboschi approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@csfet9 @nicoloboschi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.