Changeset 0.9.1 (#51)
This commit is contained in:
@@ -170,7 +170,7 @@ func (p *AnthropicProvider) ListModels(_ context.Context, _ ProviderConfig) ([]M
|
||||
|
||||
out := make([]Model, 0, len(modelIDs))
|
||||
for _, m := range modelIDs {
|
||||
caps, _ := capabilities.LookupKnownModel(m.id)
|
||||
caps := capabilities.InferCapabilities(m.id)
|
||||
out = append(out, Model{
|
||||
ID: m.id,
|
||||
Name: m.name,
|
||||
|
||||
@@ -193,11 +193,8 @@ func (p *OpenAIProvider) ListModels(ctx context.Context, cfg ProviderConfig) ([]
|
||||
|
||||
out := make([]Model, 0, len(result.Data))
|
||||
for _, m := range result.Data {
|
||||
// Try known table first, then heuristic
|
||||
caps, found := capabilities.LookupKnownModel(m.ID)
|
||||
if !found {
|
||||
caps = capabilities.InferCapabilities(m.ID)
|
||||
}
|
||||
// Heuristic inference from model ID
|
||||
caps := capabilities.InferCapabilities(m.ID)
|
||||
// Use context_length from API if available and we don't have it
|
||||
if m.ContextLength > 0 && caps.MaxContext == 0 {
|
||||
caps.MaxContext = m.ContextLength
|
||||
|
||||
@@ -69,11 +69,8 @@ func (p *OpenRouterProvider) ListModels(ctx context.Context, cfg ProviderConfig)
|
||||
|
||||
out := make([]Model, 0, len(result.Data))
|
||||
for _, m := range result.Data {
|
||||
// Start with known table, fall back to heuristic
|
||||
caps, found := capabilities.LookupKnownModel(m.ID)
|
||||
if !found {
|
||||
caps = capabilities.InferCapabilities(m.ID)
|
||||
}
|
||||
// Heuristic inference from model ID
|
||||
caps := capabilities.InferCapabilities(m.ID)
|
||||
|
||||
// Overlay context length from OpenRouter metadata
|
||||
if m.ContextLength > 0 && caps.MaxContext == 0 {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package providers
|
||||
|
||||
import (
|
||||
"git.gobha.me/xcaliber/chat-switchboard/capabilities"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/models"
|
||||
"context"
|
||||
"encoding/json"
|
||||
@@ -80,10 +79,7 @@ func (p *VeniceProvider) ListModels(ctx context.Context, cfg ProviderConfig) ([]
|
||||
}
|
||||
|
||||
// Venice doesn't report max output tokens directly.
|
||||
// Try known table, then derive from context.
|
||||
if known, ok := capabilities.LookupKnownModel(m.ID); ok && known.MaxOutputTokens > 0 {
|
||||
caps.MaxOutputTokens = known.MaxOutputTokens
|
||||
}
|
||||
// ResolveMaxOutput will derive from context window at resolution time.
|
||||
|
||||
var pricing *models.ModelPricing
|
||||
if spec.Pricing.Input.USD > 0 {
|
||||
|
||||
Reference in New Issue
Block a user