forked from Rockachopa/Timmy-time-dashboard
Compare commits
1 Commits
main
...
kimi/issue
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5361a0385 |
@@ -64,17 +64,10 @@ class Settings(BaseSettings):
|
|||||||
# Seconds to wait for user confirmation before auto-rejecting.
|
# Seconds to wait for user confirmation before auto-rejecting.
|
||||||
discord_confirm_timeout: int = 120
|
discord_confirm_timeout: int = 120
|
||||||
|
|
||||||
# ── AirLLM / backend selection ───────────────────────────────────────────
|
# ── Backend selection ────────────────────────────────────────────────────
|
||||||
# "ollama" — always use Ollama (default, safe everywhere)
|
# "ollama" — always use Ollama (default, safe everywhere)
|
||||||
# "airllm" — always use AirLLM (requires pip install ".[bigbrain]")
|
# "auto" — auto-detect best available backend
|
||||||
# "auto" — use AirLLM on Apple Silicon if airllm is installed,
|
timmy_model_backend: Literal["ollama", "grok", "claude", "auto"] = "ollama"
|
||||||
# fall back to Ollama otherwise
|
|
||||||
timmy_model_backend: Literal["ollama", "airllm", "grok", "claude", "auto"] = "ollama"
|
|
||||||
|
|
||||||
# AirLLM model size when backend is airllm or auto.
|
|
||||||
# Larger = smarter, but needs more RAM / disk.
|
|
||||||
# 8b ~16 GB | 70b ~140 GB | 405b ~810 GB
|
|
||||||
airllm_model_size: Literal["8b", "70b", "405b"] = "70b"
|
|
||||||
|
|
||||||
# ── Grok (xAI) — opt-in premium cloud backend ────────────────────────
|
# ── Grok (xAI) — opt-in premium cloud backend ────────────────────────
|
||||||
# Grok is a premium augmentation layer — local-first ethos preserved.
|
# Grok is a premium augmentation layer — local-first ethos preserved.
|
||||||
|
|||||||
@@ -826,7 +826,9 @@ class CascadeRouter:
|
|||||||
Summary dict with added/removed/preserved counts.
|
Summary dict with added/removed/preserved counts.
|
||||||
"""
|
"""
|
||||||
# Snapshot current runtime state keyed by provider name
|
# Snapshot current runtime state keyed by provider name
|
||||||
old_state: dict[str, tuple[ProviderMetrics, CircuitState, float | None, int, ProviderStatus]] = {}
|
old_state: dict[
|
||||||
|
str, tuple[ProviderMetrics, CircuitState, float | None, int, ProviderStatus]
|
||||||
|
] = {}
|
||||||
for p in self.providers:
|
for p in self.providers:
|
||||||
old_state[p.name] = (
|
old_state[p.name] = (
|
||||||
p.metrics,
|
p.metrics,
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ def create_timmy(
|
|||||||
print_response(message, stream).
|
print_response(message, stream).
|
||||||
"""
|
"""
|
||||||
resolved = _resolve_backend(backend)
|
resolved = _resolve_backend(backend)
|
||||||
size = model_size or settings.airllm_model_size
|
size = model_size or "70b"
|
||||||
|
|
||||||
if resolved == "claude":
|
if resolved == "claude":
|
||||||
from timmy.backends import ClaudeBackend
|
from timmy.backends import ClaudeBackend
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ def test_create_timmy_respects_custom_ollama_url():
|
|||||||
mock_settings.ollama_url = custom_url
|
mock_settings.ollama_url = custom_url
|
||||||
mock_settings.ollama_num_ctx = 4096
|
mock_settings.ollama_num_ctx = 4096
|
||||||
mock_settings.timmy_model_backend = "ollama"
|
mock_settings.timmy_model_backend = "ollama"
|
||||||
mock_settings.airllm_model_size = "70b"
|
|
||||||
|
|
||||||
from timmy.agent import create_timmy
|
from timmy.agent import create_timmy
|
||||||
|
|
||||||
@@ -159,7 +158,6 @@ def test_resolve_backend_auto_uses_airllm_on_apple_silicon():
|
|||||||
patch("timmy.agent.settings") as mock_settings,
|
patch("timmy.agent.settings") as mock_settings,
|
||||||
):
|
):
|
||||||
mock_settings.timmy_model_backend = "auto"
|
mock_settings.timmy_model_backend = "auto"
|
||||||
mock_settings.airllm_model_size = "70b"
|
|
||||||
mock_settings.ollama_model = "llama3.2"
|
mock_settings.ollama_model = "llama3.2"
|
||||||
|
|
||||||
from timmy.agent import _resolve_backend
|
from timmy.agent import _resolve_backend
|
||||||
@@ -174,7 +172,6 @@ def test_resolve_backend_auto_falls_back_on_non_apple():
|
|||||||
patch("timmy.agent.settings") as mock_settings,
|
patch("timmy.agent.settings") as mock_settings,
|
||||||
):
|
):
|
||||||
mock_settings.timmy_model_backend = "auto"
|
mock_settings.timmy_model_backend = "auto"
|
||||||
mock_settings.airllm_model_size = "70b"
|
|
||||||
mock_settings.ollama_model = "llama3.2"
|
mock_settings.ollama_model = "llama3.2"
|
||||||
|
|
||||||
from timmy.agent import _resolve_backend
|
from timmy.agent import _resolve_backend
|
||||||
@@ -259,7 +256,6 @@ def test_create_timmy_includes_tools_for_large_model():
|
|||||||
mock_settings.ollama_url = "http://localhost:11434"
|
mock_settings.ollama_url = "http://localhost:11434"
|
||||||
mock_settings.ollama_num_ctx = 4096
|
mock_settings.ollama_num_ctx = 4096
|
||||||
mock_settings.timmy_model_backend = "ollama"
|
mock_settings.timmy_model_backend = "ollama"
|
||||||
mock_settings.airllm_model_size = "70b"
|
|
||||||
mock_settings.telemetry_enabled = False
|
mock_settings.telemetry_enabled = False
|
||||||
|
|
||||||
from timmy.agent import create_timmy
|
from timmy.agent import create_timmy
|
||||||
|
|||||||
Reference in New Issue
Block a user