Class: Legion::Extensions::Llm::Inventory::LaneRecord

Inherits:
Data
  • Object
show all
Defined in:
lib/legion/extensions/llm/inventory/records.rb

Overview

An executable lane derived by the registry from one supported operation of an OfferingRecord, with its write-time weight pair copied unchanged. See section 10.3.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ LaneRecord

Returns a new instance of LaneRecord.



394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/legion/extensions/llm/inventory/records.rb', line 394

def initialize(**kwargs)
  RecordSupport.check_unknown_kwargs!(kwargs: kwargs, members: self.class.members)
  weight_inputs, base_weight = RecordSupport.validated_weight_pair(
    weight_inputs: kwargs[:weight_inputs], base_weight: kwargs[:base_weight]
  )
  instance_key = kwargs[:instance_key]
  callable_handle = kwargs[:callable_handle]
  raise Errors::ValidationError, 'instance_key must be an InstanceKey' unless instance_key.is_a?(Identity::InstanceKey)
  raise Errors::ValidationError, 'callable_handle must be a CallableHandle' unless callable_handle.is_a?(CallableHandle)

  family = RecordSupport.normalize_provider_family(value: kwargs[:provider_family])
  resolved_instance = Identity.normalize_text(value: kwargs[:instance_id], field: :instance_id)
  unless family == instance_key.provider_family && resolved_instance == instance_key.instance_id
    raise Errors::ValidationError, 'provider_family and instance_id must equal instance_key'
  end

  canonical_model = Identity.normalize_text(value: kwargs[:model], field: :model)
  canonical_operation = Taxonomies.normalize_operation(value: kwargs[:operation], allow_aliases: false)
  Identity.validate_lane_id!(
    value: kwargs[:lane_id], instance_key: instance_key, operation: canonical_operation,
    model: canonical_model, offering_id: kwargs[:offering_id]
  )

  super(
    lane_id: kwargs[:lane_id].dup.freeze,
    offering_id: kwargs[:offering_id].dup.freeze,
    instance_key: instance_key,
    provider_family: family,
    instance_id: resolved_instance,
    model: canonical_model,
    tier: Identity.normalize_enum(value: kwargs[:tier], field: :tier, allowed: Taxonomies::TIERS),
    operation: canonical_operation,
    capability_evidence: RecordSupport.validate_capability_evidence!(kwargs[:capability_evidence]),
    quota_domain: kwargs[:quota_domain].nil? ? nil : RecordSupport.validate_quota_domain_value!(value: kwargs[:quota_domain], field: :quota_domain),
    metadata: RecordSupport.(value: kwargs[:metadata]),
    callable_handle: callable_handle,
    publication_source: RecordSupport.publication_source!(value: kwargs[:publication_source]),
    weight_inputs: weight_inputs,
    base_weight: base_weight,
    **RecordSupport.scalar_value_evidences(kwargs)
  )
end

Instance Attribute Details

#base_weightObject (readonly)

Returns the value of attribute base_weight

Returns:

  • (Object)

    the current value of base_weight



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def base_weight
  @base_weight
end

#callable_handleObject (readonly)

Returns the value of attribute callable_handle

Returns:

  • (Object)

    the current value of callable_handle



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def callable_handle
  @callable_handle
end

#capability_evidenceObject (readonly)

Returns the value of attribute capability_evidence

Returns:

  • (Object)

    the current value of capability_evidence



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def capability_evidence
  @capability_evidence
end

#context_evidenceObject (readonly)

Returns the value of attribute context_evidence

Returns:

  • (Object)

    the current value of context_evidence



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def context_evidence
  @context_evidence
end

#embedding_dimensions_evidenceObject (readonly)

Returns the value of attribute embedding_dimensions_evidence

Returns:

  • (Object)

    the current value of embedding_dimensions_evidence



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def embedding_dimensions_evidence
  @embedding_dimensions_evidence
end

#instance_idObject (readonly)

Returns the value of attribute instance_id

Returns:

  • (Object)

    the current value of instance_id



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def instance_id
  @instance_id
end

#instance_keyObject (readonly)

Returns the value of attribute instance_key

Returns:

  • (Object)

    the current value of instance_key



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def instance_key
  @instance_key
end

#lane_idObject (readonly)

Returns the value of attribute lane_id

Returns:

  • (Object)

    the current value of lane_id



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def lane_id
  @lane_id
end

#max_output_evidenceObject (readonly)

Returns the value of attribute max_output_evidence

Returns:

  • (Object)

    the current value of max_output_evidence



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def max_output_evidence
  @max_output_evidence
end

#metadataObject (readonly)

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def 
  @metadata
end

#modelObject (readonly)

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def model
  @model
end

#model_revision_evidenceObject (readonly)

Returns the value of attribute model_revision_evidence

Returns:

  • (Object)

    the current value of model_revision_evidence



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def model_revision_evidence
  @model_revision_evidence
end

#offering_idObject (readonly)

Returns the value of attribute offering_id

Returns:

  • (Object)

    the current value of offering_id



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def offering_id
  @offering_id
end

#operationObject (readonly)

Returns the value of attribute operation

Returns:

  • (Object)

    the current value of operation



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def operation
  @operation
end

#provider_familyObject (readonly)

Returns the value of attribute provider_family

Returns:

  • (Object)

    the current value of provider_family



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def provider_family
  @provider_family
end

#publication_sourceObject (readonly)

Returns the value of attribute publication_source

Returns:

  • (Object)

    the current value of publication_source



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def publication_source
  @publication_source
end

#quota_domainObject (readonly)

Returns the value of attribute quota_domain

Returns:

  • (Object)

    the current value of quota_domain



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def quota_domain
  @quota_domain
end

#tierObject (readonly)

Returns the value of attribute tier

Returns:

  • (Object)

    the current value of tier



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def tier
  @tier
end

#tokenizer_evidenceObject (readonly)

Returns the value of attribute tokenizer_evidence

Returns:

  • (Object)

    the current value of tokenizer_evidence



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def tokenizer_evidence
  @tokenizer_evidence
end

#weight_inputsObject (readonly)

Returns the value of attribute weight_inputs

Returns:

  • (Object)

    the current value of weight_inputs



388
389
390
# File 'lib/legion/extensions/llm/inventory/records.rb', line 388

def weight_inputs
  @weight_inputs
end