Added Pseudo FIM Feature #3
Open
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.
-Added Pseudo FIM feature which provides in line completion for use with models not specifically designed for FIM. This allows for in line completions with models such as gpt-oss-20b/120b.
-Added Pseudo FIM system prompt preference which is used when Pseudo FIM is enabled in the models preferences.
-This feature works well in LM Studio/OpenAI and Ollama. Implemented, but untested for Mistral.
-When Pseudo FIM is not enabled, the behavior should be identical to the original FIM implementation (requiring a FIM enabled model).
Notes: Interestingly, Pseudo FIM mode still works well with the qwen2.5-coder models. It works reasonably well with meta-llama-3.1-8b-instruct, gemma-3-12b. It works very well with gpt-oss-20b.
Future possibilities: This new feature uses a system prompt to instruct the model to behave like a FIM model. Future work should be done to appropriately automatically supply more context with this system prompt (or the user prompt) so the Pseudo FIM model may consider fuller context in its completions.
Please test with Mistral as I am not set up to do that.
I tried to follow the existing codes style and approach. Please, feel free to improve this contribution.