roadmodel 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {roadmodel-0.2.2 → roadmodel-0.2.3}/PKG-INFO +1 -1
  2. {roadmodel-0.2.2 → roadmodel-0.2.3}/pyproject.toml +1 -1
  3. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/__init__.py +1 -1
  4. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/providers/__init__.py +1 -0
  5. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/providers/anthropic.py +9 -0
  6. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/providers/google.py +8 -0
  7. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/providers/openai.py +7 -0
  8. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/recommend.py +6 -1
  9. {roadmodel-0.2.2 → roadmodel-0.2.3}/.gitignore +0 -0
  10. {roadmodel-0.2.2 → roadmodel-0.2.3}/LICENSE +0 -0
  11. {roadmodel-0.2.2 → roadmodel-0.2.3}/NOTICE +0 -0
  12. {roadmodel-0.2.2 → roadmodel-0.2.3}/README.md +0 -0
  13. {roadmodel-0.2.2 → roadmodel-0.2.3}/docs/catalog.json +0 -0
  14. {roadmodel-0.2.2 → roadmodel-0.2.3}/docs/model-selector.txt +0 -0
  15. {roadmodel-0.2.2 → roadmodel-0.2.3}/docs/model-tier-cost-scale.md +0 -0
  16. {roadmodel-0.2.2 → roadmodel-0.2.3}/docs/templates/phase-roadmap-template.md +0 -0
  17. {roadmodel-0.2.2 → roadmodel-0.2.3}/docs/user-context.example.md +0 -0
  18. {roadmodel-0.2.2 → roadmodel-0.2.3}/hatch_build.py +0 -0
  19. {roadmodel-0.2.2 → roadmodel-0.2.3}/infra/README.md +0 -0
  20. {roadmodel-0.2.2 → roadmodel-0.2.3}/infra/supabase/README.md +0 -0
  21. {roadmodel-0.2.2 → roadmodel-0.2.3}/roadmodel/data/catalog.json +0 -0
  22. {roadmodel-0.2.2 → roadmodel-0.2.3}/roadmodel/data/model-selector.txt +0 -0
  23. {roadmodel-0.2.2 → roadmodel-0.2.3}/roadmodel/data/model-tier-cost-scale.md +0 -0
  24. {roadmodel-0.2.2 → roadmodel-0.2.3}/roadmodel/data/phase-roadmap-template.md +0 -0
  25. {roadmodel-0.2.2 → roadmodel-0.2.3}/roadmodel/data/user-context.example.md +0 -0
  26. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/__main__.py +0 -0
  27. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/cli.py +0 -0
  28. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/config.py +0 -0
  29. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/cost.py +0 -0
  30. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/errors.py +0 -0
  31. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/mcp_server.py +0 -0
  32. {roadmodel-0.2.2 → roadmodel-0.2.3}/src/roadmodel/user_context.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roadmodel
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: BYO-key CLI that recommends the right AI model, platform, and settings for a prompt.
5
5
  Project-URL: Homepage, https://roadmodel.ai
6
6
  Project-URL: Repository, https://github.com/nathanramoscfa/roadmodel
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "roadmodel"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "BYO-key CLI that recommends the right AI model, platform, and settings for a prompt."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,2 +1,2 @@
1
1
  # src/roadmodel/__init__.py
2
- __version__ = "0.2.2"
2
+ __version__ = "0.2.3"
@@ -13,4 +13,5 @@ class ProviderAdapter(Protocol):
13
13
  model: str | None = None,
14
14
  api_key: str,
15
15
  max_output_tokens: int | None = None,
16
+ thinking_budget: int | None = None,
16
17
  ) -> str: ...
@@ -13,7 +13,16 @@ def recommend(
13
13
  model: str | None = None,
14
14
  api_key: str,
15
15
  max_output_tokens: int | None = None,
16
+ thinking_budget: int | None = None,
16
17
  ) -> str:
18
+ # thinking_budget is accepted for ProviderAdapter Protocol parity but
19
+ # intentionally NOT forwarded: it is a Gemini-specific knob for the
20
+ # recommender latency work (issue #132). Anthropic extended-thinking has
21
+ # different semantics (a `thinking` block with its own budget_tokens and
22
+ # minimums) and the recommender response shape does not tolerate small
23
+ # caps on Anthropic at all (PR #128). Anthropic reasoning control is
24
+ # Phase 5 paid-frontier scope.
25
+ _ = thinking_budget
17
26
  try:
18
27
  from anthropic import Anthropic, APIError
19
28
  except Exception as exc: # pragma: no cover - dependency/runtime guard
@@ -15,6 +15,7 @@ def recommend(
15
15
  model: str | None = None,
16
16
  api_key: str,
17
17
  max_output_tokens: int | None = None,
18
+ thinking_budget: int | None = None,
18
19
  ) -> str:
19
20
  try:
20
21
  from google import genai
@@ -32,6 +33,13 @@ def recommend(
32
33
  config: Any = {"system_instruction": system}
33
34
  if max_output_tokens is not None:
34
35
  config["max_output_tokens"] = max_output_tokens
36
+ if thinking_budget is not None:
37
+ # Gemini 2.5+ Flash reasons by default, and that reasoning is
38
+ # decoded before the visible answer (and counts against
39
+ # max_output_tokens). thinking_budget caps it: 0 disables
40
+ # thinking entirely, a small value bounds it. `is not None` —
41
+ # not truthiness — because 0 is a meaningful value (thinking off).
42
+ config["thinking_config"] = {"thinking_budget": thinking_budget}
35
43
  response = client.models.generate_content(
36
44
  model=model or DEFAULT_MODEL,
37
45
  contents=prompt,
@@ -31,7 +31,14 @@ def recommend(
31
31
  model: str | None = None,
32
32
  api_key: str,
33
33
  max_output_tokens: int | None = None,
34
+ thinking_budget: int | None = None,
34
35
  ) -> str:
36
+ # thinking_budget is accepted for ProviderAdapter Protocol parity but
37
+ # intentionally NOT forwarded: it is a Gemini-specific knob for the
38
+ # recommender latency work (issue #132). OpenAI reasoning control uses a
39
+ # different mechanism (`reasoning.effort` on reasoning models), out of
40
+ # scope for the free-tier recommender, which runs on Gemini Flash.
41
+ _ = thinking_budget
35
42
  try:
36
43
  from openai import APIError, OpenAI
37
44
  except Exception as exc: # pragma: no cover - dependency/runtime guard
@@ -124,6 +124,7 @@ def recommend(
124
124
  config: Config,
125
125
  *,
126
126
  max_output_tokens: int | None = None,
127
+ thinking_budget: int | None = None,
127
128
  ) -> dict[str, str]:
128
129
  user_context_text = user_context.read(config.user_context_path)
129
130
  system_prompt, user_prompt = build_prompt(prompt, user_context_text=user_context_text)
@@ -134,6 +135,7 @@ def recommend(
134
135
  model=config.model,
135
136
  api_key=config.api_key,
136
137
  max_output_tokens=max_output_tokens,
138
+ thinking_budget=thinking_budget,
137
139
  )
138
140
  return parse_response(raw_response)
139
141
 
@@ -169,9 +171,12 @@ def recommend_structured(
169
171
  output_tokens: int | None = None,
170
172
  max_mode: bool = False,
171
173
  max_output_tokens: int | None = None,
174
+ thinking_budget: int | None = None,
172
175
  ) -> dict[str, Any]:
173
176
  """Return roadmap-style structured output plus optional cost estimates."""
174
- base = recommend(prompt, config, max_output_tokens=max_output_tokens)
177
+ base = recommend(
178
+ prompt, config, max_output_tokens=max_output_tokens, thinking_budget=thinking_budget
179
+ )
175
180
  payload: dict[str, Any] = {
176
181
  "model": base["model"],
177
182
  "platform": base["platform"],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes