mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 17:02:11 +00:00
refactor(ai): Implement unified model system with type-safe createLLM
- Add Model interface to types.ts with normalized structure - Create type-safe generic createLLM function with provider-specific model constraints - Generate models from OpenRouter API and models.dev data - Strip provider prefixes for direct providers (google, openai, anthropic, xai) - Keep full model IDs for OpenRouter-proxied models - Clean separation: types.ts (Model interface), models.ts (factory logic), models.generated.ts (data) - Remove old model scripts and unused dependencies - Rename GeminiLLM to GoogleLLM for consistency - Add tests for new providers (xAI, Groq, Cerebras, OpenRouter) - Support 181 tool-capable models across 7 providers with full type safety
This commit is contained in:
parent
3f36051bc6
commit
c7618db3f7
8 changed files with 409 additions and 418 deletions
|
|
@ -3,41 +3,30 @@
|
|||
|
||||
export const version = "0.5.8";
|
||||
|
||||
// Export generated models and factory
|
||||
// Export generated models data
|
||||
export { PROVIDERS } from "./models.generated.js";
|
||||
|
||||
// Export models utilities and types
|
||||
export {
|
||||
ANTHROPIC_MODELS,
|
||||
type AnthropicModel,
|
||||
type CreateLLMOptions,
|
||||
type CerebrasModel,
|
||||
createLLM,
|
||||
GEMINI_MODELS,
|
||||
type GeminiModel,
|
||||
type ModelData,
|
||||
OPENAI_COMPATIBLE_PROVIDERS,
|
||||
OPENAI_MODELS,
|
||||
type OpenAICompatibleProvider,
|
||||
type GoogleModel,
|
||||
type GroqModel,
|
||||
type Model,
|
||||
type OpenAIModel,
|
||||
type ProviderData,
|
||||
} from "./models.generated.js";
|
||||
// Export models utilities
|
||||
export {
|
||||
getAllProviders,
|
||||
getModelInfo,
|
||||
getProviderInfo,
|
||||
getProviderModels,
|
||||
loadModels,
|
||||
type ModalityInput,
|
||||
type ModalityOutput,
|
||||
type ModelInfo,
|
||||
type ModelsData,
|
||||
type ProviderInfo,
|
||||
supportsThinking,
|
||||
supportsTools,
|
||||
type OpenRouterModel,
|
||||
PROVIDER_CONFIG,
|
||||
type ProviderModels,
|
||||
type ProviderToLLM,
|
||||
type XAIModel,
|
||||
} from "./models.js";
|
||||
|
||||
// Export providers
|
||||
export { AnthropicLLM } from "./providers/anthropic.js";
|
||||
export { GeminiLLM } from "./providers/gemini.js";
|
||||
export { GoogleLLM } from "./providers/gemini.js";
|
||||
export { OpenAICompletionsLLM } from "./providers/openai-completions.js";
|
||||
export { OpenAIResponsesLLM } from "./providers/openai-responses.js";
|
||||
|
||||
// Export types
|
||||
export type * from "./types.js";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue