@oh-my-pi/pi-catalog 17.2.0 → 17.2.1
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.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [17.2.1] - 2026-07-30
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed Ollama model-manager caches being reused after the configured base URL changed by scoping cache namespaces to the normalized native discovery endpoint, including reverse-proxy path prefixes ([#7087](https://github.com/can1357/oh-my-pi/issues/7087)).
|
|
10
|
+
|
|
5
11
|
## [17.2.0] - 2026-07-30
|
|
6
12
|
|
|
7
13
|
### Added
|
|
@@ -3,5 +3,7 @@ export interface ModelCacheProviderIdOptions {
|
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function getDefaultModelDiscoveryBaseUrl(providerId: string): string | undefined;
|
|
6
|
+
/** Resolve an Ollama model-cache namespace scoped to the normalized discovery endpoint. */
|
|
7
|
+
export declare function resolveOllamaModelCacheProviderId(providerId: string, baseUrl?: string): string;
|
|
6
8
|
/** Resolve the cache namespace used by a provider's model-manager options without constructing those options. */
|
|
7
9
|
export declare function resolveModelCacheProviderId(providerId: string, options?: ModelCacheProviderIdOptions): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-catalog",
|
|
4
|
-
"version": "17.2.
|
|
4
|
+
"version": "17.2.1",
|
|
5
5
|
"description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@bufbuild/protobuf": "^2.12.1",
|
|
38
|
-
"@oh-my-pi/pi-utils": "17.2.
|
|
38
|
+
"@oh-my-pi/pi-utils": "17.2.1",
|
|
39
39
|
"arktype": "2.2.3",
|
|
40
40
|
"zod": "^4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@oh-my-pi/pi-ai": "17.2.
|
|
43
|
+
"@oh-my-pi/pi-ai": "17.2.1",
|
|
44
44
|
"@types/bun": "^1.3.14"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
@@ -5,6 +5,8 @@ export interface ModelCacheProviderIdOptions {
|
|
|
5
5
|
|
|
6
6
|
export function getDefaultModelDiscoveryBaseUrl(providerId: string): string | undefined {
|
|
7
7
|
switch (providerId) {
|
|
8
|
+
case "ollama":
|
|
9
|
+
return "http://127.0.0.1:11434";
|
|
8
10
|
case "litellm":
|
|
9
11
|
return Bun.env.LITELLM_BASE_URL ?? "http://localhost:4000/v1";
|
|
10
12
|
case "opencode-go":
|
|
@@ -18,9 +20,26 @@ export function getDefaultModelDiscoveryBaseUrl(providerId: string): string | un
|
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
/** Resolve an Ollama model-cache namespace scoped to the normalized discovery endpoint. */
|
|
24
|
+
export function resolveOllamaModelCacheProviderId(providerId: string, baseUrl?: string): string {
|
|
25
|
+
const defaultBaseUrl = getDefaultModelDiscoveryBaseUrl("ollama")!;
|
|
26
|
+
let endpoint = defaultBaseUrl;
|
|
27
|
+
try {
|
|
28
|
+
const parsed = new URL(baseUrl ?? defaultBaseUrl);
|
|
29
|
+
const trimmedPath = parsed.pathname.replace(/\/+$/g, "");
|
|
30
|
+
const nativePath = trimmedPath.endsWith("/v1") ? trimmedPath.slice(0, -3) : trimmedPath;
|
|
31
|
+
endpoint = `${parsed.protocol}//${parsed.host}${nativePath}`;
|
|
32
|
+
} catch {
|
|
33
|
+
// Malformed URLs fall back during discovery, so share the default endpoint's cache.
|
|
34
|
+
}
|
|
35
|
+
return `${providerId}:ollama-models-v1:${Bun.hash(endpoint).toString(36)}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
/** Resolve the cache namespace used by a provider's model-manager options without constructing those options. */
|
|
22
39
|
export function resolveModelCacheProviderId(providerId: string, options: ModelCacheProviderIdOptions = {}): string {
|
|
23
40
|
switch (providerId) {
|
|
41
|
+
case "ollama":
|
|
42
|
+
return resolveOllamaModelCacheProviderId(providerId, options.baseUrl);
|
|
24
43
|
case "cursor":
|
|
25
44
|
return "cursor:max-mode-v2";
|
|
26
45
|
case "litellm": {
|
|
@@ -2300,6 +2300,7 @@ export function ollamaModelManagerOptions(config?: OllamaModelManagerConfig): Mo
|
|
|
2300
2300
|
const resolveMetadata = createOllamaMetadataResolver(nativeBaseUrl, config?.fetch);
|
|
2301
2301
|
return {
|
|
2302
2302
|
providerId: "ollama",
|
|
2303
|
+
cacheProviderId: resolveModelCacheProviderId("ollama", { baseUrl }),
|
|
2303
2304
|
fetchDynamicModels: async () => {
|
|
2304
2305
|
const openAiCompatible = await fetchOpenAICompatibleModels({
|
|
2305
2306
|
api: "openai-responses",
|