langflow
langflow copied to clipboard
fix: add safe casting and complete param binding for ChatOllamaComponent
- Introduce safe_cast for all numeric fields to avoid runtime errors from blank or invalid inputs.
- Fully bind new and existing Ollama API parameters (e.g., temperature, top_k, tfs_z, repeat_penalty, frequency_penalty).
- Expose keep_alive_mode/value/unit so users can extend model memory retention beyond the previous short default—enabling faster warm-starts and lower latency.
- Reflect several new parameters from the latest Ollama API for more granular control (e.g., num_ctx, num_gpu, num_thread).
CodSpeed Performance Report
Merging #8228 will degrade performances by 17.07%
Comparing YamonBot:patch-4 (e38c547) with main (a0c00c0)
Summary
⚡ 1 improvements
❌ 1 regressions
✅ 17 untouched benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | test_cancel_build_success |
255.1 ms | 220.4 ms | +15.76% |
| ❌ | test_cancel_nonexistent_build |
8.2 ms | 9.8 ms | -17.07% |
Oh no, I committed without realizing there was a branching issue.
This suggestion applies only to the following file:
src/backend/base/langflow/components/models/ollama.py