CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-vllm

tessl install tessl/pypi-vllm@0.10.0

A high-throughput and memory-efficient inference and serving engine for LLMs

Agent Success

Agent success rate when using this tile

69%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.33x

Baseline

Agent success rate without this tile

52%

task.mdevals/scenario-6/

Text Generation with Advanced Configuration

Build a text generation utility that provides fine-grained control over how language models generate text responses. The utility should support various generation strategies including deterministic generation, creative generation with randomness controls, and generating multiple alternative completions.

Requirements

Configuration Options

The utility must support the following generation configuration options:

  • Temperature control: Allow users to control randomness in generation (0 for deterministic, higher values for more random)
  • Top-k sampling: Limit sampling to the k most likely next tokens
  • Top-p (nucleus) sampling: Sample from the smallest set of tokens whose cumulative probability exceeds p
  • Repetition control: Apply penalties to reduce repetitive text
  • Length control: Set maximum number of tokens to generate and define stop sequences
  • Multiple completions: Generate multiple different completions for the same prompt
  • Reproducibility: Support deterministic generation with seed values

Core Functionality

The utility should provide:

  1. A function that generates text with default settings (greedy decoding)
  2. A function that generates creative text with high temperature and nucleus sampling
  3. A function that generates multiple diverse completions for the same input
  4. A function that generates reproducible outputs using seed values

Test Cases

  • Calling the default generation function with prompt "The capital of France is" produces a deterministic, focused completion @test
  • Calling the creative generation function with prompt "Once upon a time" and high temperature produces varied outputs across multiple calls @test
  • Calling the multiple completions function with prompt "The best programming language is" and n=3 returns exactly 3 different completions @test
  • Calling the reproducible generation function twice with the same prompt "Hello world" and same seed produces identical outputs @test

Implementation

@generates

API

def generate_default(model: str, prompt: str) -> str:
    """
    Generate text using default settings (greedy decoding).

    Args:
        model: Name or path of the model to use
        prompt: Input text prompt

    Returns:
        Generated text completion
    """
    pass

def generate_creative(model: str, prompt: str, temperature: float = 0.8, top_p: float = 0.9) -> str:
    """
    Generate creative text with controlled randomness.

    Args:
        model: Name or path of the model to use
        prompt: Input text prompt
        temperature: Sampling temperature (higher = more random)
        top_p: Nucleus sampling threshold

    Returns:
        Generated text completion
    """
    pass

def generate_multiple(model: str, prompt: str, n: int = 3) -> list[str]:
    """
    Generate multiple diverse completions for the same prompt.

    Args:
        model: Name or path of the model to use
        prompt: Input text prompt
        n: Number of completions to generate

    Returns:
        List of generated text completions
    """
    pass

def generate_reproducible(model: str, prompt: str, seed: int, max_tokens: int = 50) -> str:
    """
    Generate text with reproducible results using a seed.

    Args:
        model: Name or path of the model to use
        prompt: Input text prompt
        seed: Random seed for reproducibility
        max_tokens: Maximum number of tokens to generate

    Returns:
        Generated text completion
    """
    pass

Dependencies { .dependencies }

vLLM { .dependency }

Provides high-throughput LLM inference capabilities with fine-grained sampling control.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/vllm@0.10.x
tile.json