my prefect server setup prefect-metrics.waow.tech
python orchestration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use prefect Variable for weave model selection

reads `weave-model` variable at runtime (default: claude-sonnet-4-6).
changeable via `prefect variable set weave-model <model>` without redeploy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

zzstoatzz 06f688b3 5d4b6c63

+9 -3
+9 -3
flows/weave.py
··· 22 22 from prefect.blocks.system import Secret 23 23 from prefect.cache_policies import CachePolicy 24 24 from prefect.context import TaskRunContext 25 + from prefect.variables import Variable 25 26 26 27 from mps.phi import TagMerge, TagRelationship 27 28 ··· 184 185 tag_info: dict[str, dict], 185 186 tag_embeddings: dict[str, list[float]], 186 187 api_key: str, 188 + model_name: str = "claude-sonnet-4-6", 187 189 ) -> list[dict[str, Any]]: 188 190 """Give the LLM the full tag inventory and let it propose consolidations.""" 189 191 # format every tag with usage context so the LLM can make informed decisions ··· 202 204 inventory = "\n".join(tag_lines) 203 205 204 206 model = AnthropicModel( 205 - "claude-sonnet-4-6", provider=AnthropicProvider(api_key=api_key) 207 + model_name, provider=AnthropicProvider(api_key=api_key) 206 208 ) 207 209 agent = Agent( 208 210 model, ··· 352 354 user_tag_sets: dict[str, list[str]], 353 355 merged_aliases: set[str], 354 356 api_key: str, 357 + model_name: str = "claude-sonnet-4-6", 355 358 ) -> list[dict[str, Any]]: 356 359 """Give the LLM the full tag list with co-occurrence context to find relationships.""" 357 360 tags = [t for t in sorted(tag_info.keys()) if t not in merged_aliases] ··· 385 388 inventory = "\n".join(tag_lines) 386 389 387 390 model = AnthropicModel( 388 - "claude-sonnet-4-6", provider=AnthropicProvider(api_key=api_key) 391 + model_name, provider=AnthropicProvider(api_key=api_key) 389 392 ) 390 393 agent = Agent( 391 394 model, ··· 774 777 tpuf_key = (await Secret.load("turbopuffer-api-key")).get() 775 778 openai_key = (await Secret.load("openai-api-key")).get() 776 779 anthropic_key = (await Secret.load("anthropic-api-key")).get() 780 + model_name = await Variable.get("weave-model", default="claude-sonnet-4-6") 781 + print(f"using model: {model_name}") 777 782 778 783 # --- phase 1: collect and deduplicate tags --- 779 784 tag_data = collect_all_tags(tpuf_key) ··· 791 796 792 797 tags_text = "\n".join(tags) 793 798 merge_dicts = await identify_tag_merges( 794 - tags_text, tag_info, tag_embeddings, anthropic_key 799 + tags_text, tag_info, tag_embeddings, anthropic_key, model_name=model_name 795 800 ) 796 801 797 802 # collect all aliases for filtering in phase 2 ··· 816 821 user_tag_sets, 817 822 merged_aliases, 818 823 anthropic_key, 824 + model_name=model_name, 819 825 ) 820 826 print(f"phase 2: discovered {len(rel_dicts)} tag relationships") 821 827