mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-21 20:04:55 +00:00
move pi-mono into companion-cloud as apps/companion-os
- Copy all pi-mono source into apps/companion-os/ - Update Dockerfile to COPY pre-built binary instead of downloading from GitHub Releases - Update deploy-staging.yml to build pi from source (bun compile) before Docker build - Add apps/companion-os/** to path triggers - No more cross-repo dispatch needed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
0250f72976
579 changed files with 206942 additions and 0 deletions
66
packages/web-ui/src/storage/stores/custom-providers-store.ts
Normal file
66
packages/web-ui/src/storage/stores/custom-providers-store.ts
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
import type { Model } from "@mariozechner/pi-ai";
|
||||
import { Store } from "../store.js";
|
||||
import type { StoreConfig } from "../types.js";
|
||||
|
||||
export type AutoDiscoveryProviderType =
|
||||
| "ollama"
|
||||
| "llama.cpp"
|
||||
| "vllm"
|
||||
| "lmstudio";
|
||||
|
||||
export type CustomProviderType =
|
||||
| AutoDiscoveryProviderType // Auto-discovery - models fetched on-demand
|
||||
| "openai-completions" // Manual models - stored in provider.models
|
||||
| "openai-responses" // Manual models - stored in provider.models
|
||||
| "anthropic-messages"; // Manual models - stored in provider.models
|
||||
|
||||
export interface CustomProvider {
|
||||
id: string; // UUID
|
||||
name: string; // Display name, also used as Model.provider
|
||||
type: CustomProviderType;
|
||||
baseUrl: string;
|
||||
apiKey?: string; // Optional, applies to all models
|
||||
|
||||
// For manual types ONLY - models stored directly on provider
|
||||
// Auto-discovery types: models fetched on-demand, never stored
|
||||
models?: Model<any>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Store for custom LLM providers (auto-discovery servers + manual providers).
|
||||
*/
|
||||
export class CustomProvidersStore extends Store {
|
||||
getConfig(): StoreConfig {
|
||||
return {
|
||||
name: "custom-providers",
|
||||
};
|
||||
}
|
||||
|
||||
async get(id: string): Promise<CustomProvider | null> {
|
||||
return this.getBackend().get("custom-providers", id);
|
||||
}
|
||||
|
||||
async set(provider: CustomProvider): Promise<void> {
|
||||
await this.getBackend().set("custom-providers", provider.id, provider);
|
||||
}
|
||||
|
||||
async delete(id: string): Promise<void> {
|
||||
await this.getBackend().delete("custom-providers", id);
|
||||
}
|
||||
|
||||
async getAll(): Promise<CustomProvider[]> {
|
||||
const keys = await this.getBackend().keys("custom-providers");
|
||||
const providers: CustomProvider[] = [];
|
||||
for (const key of keys) {
|
||||
const provider = await this.get(key);
|
||||
if (provider) {
|
||||
providers.push(provider);
|
||||
}
|
||||
}
|
||||
return providers;
|
||||
}
|
||||
|
||||
async has(id: string): Promise<boolean> {
|
||||
return this.getBackend().has("custom-providers", id);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue