ollama-classifier

Contents:

  • Installation
    • Package Installation
    • Prerequisites
    • Development Installation
    • Building Documentation Locally
  • Usage
    • Basic Classification
    • Classification with Label Descriptions
    • Custom System Prompt
    • Choosing a Scoring Method
      • Adaptive Generation (generate)
      • Multi-Call Scoring (classify)
    • Batch Processing
    • Async Usage
    • Working with Results
    • Using Sample Data
  • Inference Backends
    • Ollama
    • vLLM
    • SGLang
    • llama.cpp
    • Constraint Mechanisms Summary
      • supports_bare_label_constraint
    • Backend Configuration
    • Switching Backends
  • API Reference
    • LLMClassifier
      • LLMClassifier
        • LLMClassifier.generate()
        • LLMClassifier.classify()
        • LLMClassifier.__init__()
        • LLMClassifier.generate()
        • LLMClassifier.classify()
        • LLMClassifier.batch_generate()
        • LLMClassifier.batch_classify()
        • LLMClassifier.agenerate()
        • LLMClassifier.aclassify()
        • LLMClassifier.abatch_generate()
        • LLMClassifier.abatch_classify()
    • ClassificationResult
      • ClassificationResult
        • ClassificationResult.prediction
        • ClassificationResult.confidence
        • ClassificationResult.probabilities
        • ClassificationResult.method
        • ClassificationResult.approximate
        • ClassificationResult.coverage
        • ClassificationResult.n_calls
        • ClassificationResult.raw_response
        • ClassificationResult.prediction
        • ClassificationResult.confidence
        • ClassificationResult.probabilities
        • ClassificationResult.method
        • ClassificationResult.approximate
        • ClassificationResult.coverage
        • ClassificationResult.n_calls
        • ClassificationResult.raw_response
        • ClassificationResult.model_config
    • ChoicesType
      • ChoicesType
    • Backends
      • LLMBackend
        • LLMBackend.__init__()
        • LLMBackend.model
        • LLMBackend.base_url
        • LLMBackend.supports_bare_label_constraint
        • LLMBackend.chat()
        • LLMBackend.score()
        • LLMBackend.tokenize()
        • LLMBackend.achat()
        • LLMBackend.ascore()
        • LLMBackend.atokenize()
      • ChatMessage
        • ChatMessage.role
        • ChatMessage.content
      • ChatResponse
        • ChatResponse.content
        • ChatResponse.label
        • ChatResponse.logprobs
        • ChatResponse.raw
      • ScoringResponse
        • ScoringResponse.completion
        • ScoringResponse.logprobs
        • ScoringResponse.raw
      • TokenLogprob
        • TokenLogprob.token
        • TokenLogprob.token_id
        • TokenLogprob.logprob
        • TokenLogprob.top_logprobs
      • Token
        • Token.text
        • Token.id
      • OllamaBackend
        • OllamaBackend.__init__()
        • OllamaBackend.supports_bare_label_constraint
        • OllamaBackend.chat()
        • OllamaBackend.score()
        • OllamaBackend.tokenize()
        • OllamaBackend.achat()
        • OllamaBackend.ascore()
        • OllamaBackend.atokenize()
      • VLLMBackend
        • VLLMBackend.supports_bare_label_constraint
        • VLLMBackend.chat()
        • VLLMBackend.score()
        • VLLMBackend.tokenize()
        • VLLMBackend.achat()
        • VLLMBackend.ascore()
        • VLLMBackend.atokenize()
      • SGLangBackend
        • SGLangBackend.supports_bare_label_constraint
        • SGLangBackend.chat()
        • SGLangBackend.score()
        • SGLangBackend.tokenize()
        • SGLangBackend.achat()
        • SGLangBackend.ascore()
        • SGLangBackend.atokenize()
      • LlamaCppBackend
        • LlamaCppBackend.supports_bare_label_constraint
        • LlamaCppBackend.chat()
        • LlamaCppBackend.score()
        • LlamaCppBackend.tokenize()
        • LlamaCppBackend.achat()
        • LlamaCppBackend.ascore()
        • LlamaCppBackend.atokenize()
      • LLMBackend
        • LLMBackend.__init__()
        • LLMBackend.model
        • LLMBackend.base_url
        • LLMBackend.supports_bare_label_constraint
        • LLMBackend.chat()
        • LLMBackend.score()
        • LLMBackend.tokenize()
        • LLMBackend.achat()
        • LLMBackend.ascore()
        • LLMBackend.atokenize()
      • OllamaBackend
        • OllamaBackend.__init__()
        • OllamaBackend.supports_bare_label_constraint
        • OllamaBackend.chat()
        • OllamaBackend.score()
        • OllamaBackend.tokenize()
        • OllamaBackend.achat()
        • OllamaBackend.ascore()
        • OllamaBackend.atokenize()
      • VLLMBackend
        • VLLMBackend.__init__()
        • VLLMBackend.supports_bare_label_constraint
        • VLLMBackend.chat()
        • VLLMBackend.score()
        • VLLMBackend.tokenize()
        • VLLMBackend.achat()
        • VLLMBackend.ascore()
        • VLLMBackend.atokenize()
      • SGLangBackend
        • SGLangBackend.__init__()
        • SGLangBackend.supports_bare_label_constraint
        • SGLangBackend.chat()
        • SGLangBackend.score()
        • SGLangBackend.tokenize()
        • SGLangBackend.achat()
        • SGLangBackend.ascore()
        • SGLangBackend.atokenize()
      • LlamaCppBackend
        • LlamaCppBackend.__init__()
        • LlamaCppBackend.supports_bare_label_constraint
        • LlamaCppBackend.chat()
        • LlamaCppBackend.score()
        • LlamaCppBackend.tokenize()
        • LlamaCppBackend.achat()
        • LlamaCppBackend.ascore()
        • LlamaCppBackend.atokenize()
    • Method Summary
    • Choosing a Scoring Method
  • Changelog
    • [0.4.1] - 2026-07-06
      • Changed
    • [0.4.0] - 2025-07-06
      • Added
      • Changed
      • Fixed
      • Removed
    • [0.3.0] - 2025-04-27
      • Added
      • Changed
    • [0.1.0] - 2024-01-01
      • Added
ollama-classifier
  • Search


© Copyright 2024, Luigi Palumbo.

Built with Sphinx using a theme provided by Read the Docs.