Commit df1f030
committed
fix(cli): silence LiteLLM 'could not pre-load' warnings at import time
LiteLLM unconditionally tries to pre-load AWS Bedrock / SageMaker
response stream shapes during 'import litellm'. When 'botocore'
isn't installed it logs two WARNING lines per invocation — but
botocore is optional and OpenAI / Anthropic / Gemini users have no
reason to install it.
Result was that every 'openkb' call printed two unhelpful warnings
above the actual output, including for terminal/agent consumers
parsing the first line of 'openkb status' to get the KB path.
Attach a 'logging.Filter' to the 'LiteLLM' logger BEFORE litellm
imports, dropping any record whose message contains 'could not
pre-load'. Real LiteLLM warnings still come through.1 parent cc52ee5 commit df1f030
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
| |||
0 commit comments