CustomModelDefinition class final
A named custom model definition (models.custom.<name>): a concrete
provider/endpoint/model triple with optional token-limit and modality
overrides, switchable at runtime with /model <name>.
Constructors
-
CustomModelDefinition({required String provider, required String baseUrl, required String model, int? contextWindow, int? maxTokens, List<
String> ? input}) -
Creates a custom model definition.
const
- CustomModelDefinition.fromYaml(String name, Object? node)
-
Parses one definition from yaml, strictly:
nameis the map key;providermust be a catalog provider name (see providerCatalog),baseUrl/modelnon-empty strings,contextWindow/maxTokenspositive integers,inputa non-empty list oftext/image.factory
Properties
- baseUrl → String
-
API base URL.
final
- contextWindow → int?
-
Total context window in tokens (catalog default when null).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
input
→ List<
String> ? -
Input modalities (
text/image; catalog default when null).final - maxTokens → int?
-
Maximum output tokens (catalog default when null).
final
- model → String
-
Model id sent to the provider.
final
- provider → String
-
Catalog provider name (
openrouter,openai,anthropic,google).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
writeYaml(
StringBuffer buffer, String indent) → void -
Writes the definition as yaml lines at
indent(string values are JSON-quoted — valid yaml scalars that round-trip any url/model id).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited