sference-cli 0.3.0__tar.gz → 0.3.1__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.
- {sference_cli-0.3.0 → sference_cli-0.3.1}/PKG-INFO +2 -2
- {sference_cli-0.3.0 → sference_cli-0.3.1}/pyproject.toml +2 -2
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/launch.py +22 -3
- {sference_cli-0.3.0 → sference_cli-0.3.1}/.gitignore +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/LICENSE +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/README.md +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/__init__.py +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/_proxy_addon.py +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/_proxy_routing.py +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/device_auth.py +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/main.py +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/proxy.py +0 -0
- {sference_cli-0.3.0 → sference_cli-0.3.1}/sference_cli/stream_cache.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sference-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: sference command-line interface
|
|
5
5
|
Project-URL: Homepage, https://sference.com
|
|
6
6
|
Project-URL: Repository, https://github.com/s-ference/sference
|
|
@@ -21,7 +21,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
22
|
Classifier: Topic :: Utilities
|
|
23
23
|
Requires-Python: >=3.10
|
|
24
|
-
Requires-Dist: sference-sdk>=0.3.
|
|
24
|
+
Requires-Dist: sference-sdk>=0.3.1
|
|
25
25
|
Requires-Dist: typer>=0.24.1
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sference-cli"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.1"
|
|
4
4
|
description = "sference command-line interface"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -23,7 +23,7 @@ classifiers = [
|
|
|
23
23
|
]
|
|
24
24
|
dependencies = [
|
|
25
25
|
"typer>=0.24.1",
|
|
26
|
-
"sference-sdk>=0.3.
|
|
26
|
+
"sference-sdk>=0.3.1",
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
[project.urls]
|
|
@@ -18,6 +18,15 @@ from .proxy import fetch_sference_model_entries, fetch_sference_models, launch_c
|
|
|
18
18
|
DEFAULT_LAUNCH_MODEL = "zai-org/GLM-5.2"
|
|
19
19
|
DEFAULT_API_BASE_URL = "https://api.sference.com"
|
|
20
20
|
|
|
21
|
+
# Thinking-effort variants stamped on every Sference model entry in the opencode
|
|
22
|
+
# config. The levels are a subset of OpenAI's ReasoningEffort enum that the platform
|
|
23
|
+
# accepts (``reasoning_effort`` on chat completions); ``none`` disables thinking, the
|
|
24
|
+
# rest enable it and each model's chat template decides what the level means. The AI
|
|
25
|
+
# SDK openai-compatible provider forwards the variant's ``reasoningEffort`` option as
|
|
26
|
+
# ``reasoning_effort`` in the request body. On models the catalog marks non-thinking
|
|
27
|
+
# the effort is a server-side no-op, so stamping every fetched model is safe.
|
|
28
|
+
OPENCODE_THINKING_VARIANTS = ("none", "medium", "high", "xhigh")
|
|
29
|
+
|
|
21
30
|
|
|
22
31
|
def resolve_api_base_url(explicit: Optional[str]) -> str:
|
|
23
32
|
if explicit:
|
|
@@ -330,8 +339,12 @@ def _write_opencode_config(*, base_url: str, model: str, models: set[str]) -> Pa
|
|
|
330
339
|
user's opencode config.
|
|
331
340
|
|
|
332
341
|
All models in ``models`` are written to the provider's ``models`` block so
|
|
333
|
-
they appear in opencode's model picker
|
|
334
|
-
|
|
342
|
+
they appear in opencode's model picker, each with the thinking-effort
|
|
343
|
+
variants in ``OPENCODE_THINKING_VARIANTS`` (selectable as
|
|
344
|
+
``sference/<model>@<level>`` or via opencode's variant switcher; no variant
|
|
345
|
+
means the server-side catalog default decides). ``model`` is the default —
|
|
346
|
+
set as the top-level ``model`` key so opencode uses Sference by default on
|
|
347
|
+
startup.
|
|
335
348
|
|
|
336
349
|
The API key is referenced as ``{env:SFERENCE_API_KEY}`` so no secret is
|
|
337
350
|
stored on disk; ``launch_opencode`` injects the resolved key into the
|
|
@@ -366,7 +379,13 @@ def _write_opencode_config(*, base_url: str, model: str, models: set[str]) -> Pa
|
|
|
366
379
|
"apiKey": "{env:SFERENCE_API_KEY}",
|
|
367
380
|
},
|
|
368
381
|
"models": {
|
|
369
|
-
m: {
|
|
382
|
+
m: {
|
|
383
|
+
"name": m,
|
|
384
|
+
"variants": {
|
|
385
|
+
level: {"options": {"reasoningEffort": level}}
|
|
386
|
+
for level in OPENCODE_THINKING_VARIANTS
|
|
387
|
+
},
|
|
388
|
+
}
|
|
370
389
|
for m in sorted(all_models)
|
|
371
390
|
},
|
|
372
391
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|