feat: add model_policy=permissive for open-weight model routing#14
Merged
seanfromthepast merged 3 commits intomainfrom Mar 12, 2026
Merged
feat: add model_policy=permissive for open-weight model routing#14seanfromthepast merged 3 commits intomainfrom
seanfromthepast merged 3 commits intomainfrom
Conversation
Clockchain and other callers can now pass model_policy: "permissive" to force generation through open-weight, distillable models (Llama, DeepSeek, Qwen, etc.) instead of restricted frontier models (Gemini, Anthropic). Changes: - New app/core/model_policy.py: shared permissiveness/provider derivation - GenerateRequest accepts model_policy field (all 3 endpoints) - resolve_model_policy() auto-selects best permissive text + Pollinations image - LLM router shortcuts to Pollinations when image_model contains "pollinations" - Pipeline TDF payload derives model_permissiveness dynamically (was hardcoded)
0b3d270 to
c53d0c7
Compare
…eneration When model_policy="permissive", the pipeline now skips the grounding step (which requires Google Search API) so that the entire generation is routed through OpenRouter + Pollinations with zero Google dependencies.
…ters Adds LLMParams schema to GenerateRequest with fine-grained control over: - temperature, max_tokens, top_p, top_k (all providers) - frequency_penalty, presence_penalty, repetition_penalty (OpenRouter) - stop sequences (all providers) - thinking_level (Google Gemini) - system_prompt_prefix/suffix for prompt injection Request-level llm_params override agent defaults (e.g. temperature=0.3) but agents retain their defaults when params are unset. Works alongside model_policy and explicit text_model/image_model — all composable. Expands OpenRouter provider to accept full parameter set and Google provider to accept top_p, top_k, and stop sequences.
seanfromthepast
approved these changes
Mar 12, 2026
seanfromthepast
approved these changes
Mar 12, 2026
seanfromthepast
approved these changes
Mar 12, 2026
realityinspector
pushed a commit
that referenced
this pull request
Mar 15, 2026
feat: add model_policy=permissive for open-weight model routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
model_policyfield to GenerateRequest — when set to"permissive", auto-selects only open-weight/distillable models (DeepSeek, Llama, Qwen, Mistral)app/core/model_policy.pywith model licensing classification and registry-aware selectionmodel_permissivenessfrom actual model used instead of hardcoded "restricted"text_model/image_modelin request always take precedence over policyMotivation
Clockchain expander requires all generated content to use only permissive/distillable models. Previously Flash defaulted to Gemini, violating this policy.
Files Changed
app/core/model_policy.pyapp/api/v1/timepoints.pyapp/core/pipeline.pyapp/core/llm_router.pyTest plan
model_policy: "permissive"— should use Llama/DeepSeek for text, Pollinations for images