Class LlmConnectionService

java.lang.Object
dev.dokimos.server.service.LlmConnectionService

@Service public class LlmConnectionService extends Object
Registers and reads LLM connections. Inline keys are encrypted before persistence; responses never carry key material. Connection names are unique across the server.
  • Constructor Details

  • Method Details

    • create

      @Transactional public LlmConnectionView create(CreateLlmConnectionRequest request, TenantScope scope)
      Registers a connection. Exactly one of an inline key or a credential reference is stored; an inline key is encrypted at rest.
      Parameters:
      request - the connection definition
      Returns:
      the public view of the saved connection
      Throws:
      IllegalStateException - if a connection with the same name already exists (mapped to 409)
    • list

      @Transactional(readOnly=true) public List<LlmConnectionView> list(TenantScope scope)
    • get

      @Transactional(readOnly=true) public LlmConnectionView get(UUID id, TenantScope scope)
      Returns a connection by id, visible under the scope.
      Throws:
      IllegalArgumentException - if no connection has the id under the scope (mapped to 404)
    • update

      @Transactional public LlmConnectionView update(UUID id, UpdateLlmConnectionRequest request, TenantScope scope)
      Replaces a connection's name, base URL, and model, and optionally its credential. A supplied inline key is encrypted and replaces the credential reference; a supplied credential reference replaces the inline key; supplying neither keeps the existing credential.
      Parameters:
      id - the connection to update
      request - the new connection definition
      Returns:
      the public view of the updated connection
      Throws:
      IllegalArgumentException - if no connection has the id (mapped to 404)
      IllegalStateException - if the new name is already taken by another connection (mapped to 409)
    • delete

      @Transactional public void delete(UUID id, TenantScope scope)
      Deletes a connection along with its judge job queue records. The eval results those jobs produced remain on their run items, so deleting a connection never removes scoring history.
      Parameters:
      id - the connection to delete
      Throws:
      IllegalArgumentException - if no connection has the id (mapped to 404)