Commit Graph
6 Commits
Author SHA1 Message Date
Asep Haryana 9a63ff1601 feat: use GGUF chat template via apply_chat_template
- Replaced manual prompt building with LlamaModel::apply_chat_template
- Uses model's baked-in Jinja template (system/user/assistant/tool format)
- Added <think> trigger after template for thinking mode
- Clean_text strips only <|im_end|>, <|im_start|>, <think>, </think>
2026-07-26 17:10:42 +07:00
Asep Haryana 495b9ed126 fix: remove /think trigger, add back <think> in clean_text
- Removed /think trigger from prompt (model generates better without it)
- Added <think> and </think> back to clean_text (model uses plain text
  thinking tags, not special tokens)
2026-07-26 16:03:18 +07:00
Asep Haryana 254532458b Revert "fix: remove /think trigger from prompt, use plain assistant prefix"
This reverts commit 7c8f747faf.
2026-07-26 15:49:04 +07:00
Asep Haryana 7c8f747faf fix: remove /think trigger from prompt, use plain assistant prefix 2026-07-26 15:48:44 +07:00
Asep Haryana d8425ea3b3 feat: switch to MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking-Q8_0 GGUF
- Updated model path + model ID for new 1B thinking model
- Updated prompt builder to use MiniCPM5 native /think trigger
- Updated clean_text to strip MiniCPM5 special tokens
- Bumped n_ctx from 2048 to 8192
2026-07-26 15:38:05 +07:00
asepharyanaandClaude Code e351d74fa4 refactor(llm-api): implement clean architecture following scraper pattern
Split monolithic 1012-line main.rs into layered hexagonal architecture:
- Domain: entity types and LlmError enum
- Application: prompt building, sampler construction, tool call parsing
- Infrastructure: LlamaEngine wrapping llama-cpp-2 with isolated unsafe transmute
- Presentation: Axum handlers, middleware (auth), error chain, router
- Config: type-safe AppConfig with LazyLock
- Bootstrap: Application struct with build() + run()

Resolves build_sampler/build_sampler_params duplication.
Adds simple web chat UI at GET /.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-07-25 15:07:19 +07:00