Examples¶
Juicer usage examples. All examples call the vLLM OpenAI-compatible API directly — no extra framework needed.
Prerequisites¶
Start the Juicer model service:
vllm serve "$MODEL_ID" --port 8000 --tensor-parallel-size 2 --max-model-len 32768
Scripts¶
Script |
Purpose |
Usage |
|---|---|---|
|
Minimal call: single-text cleaning |
|
|
Batch cleaning: read JSONL → call API → write results |
|
|
PII redaction: email/phone placeholder replacement |
|
Output formats¶
Juicer always outputs one of two contracts:
tagged_text (cleaning / filtering / redaction):
<status>KEEP</status><clean_text>processed text</clean_text>
<status>DROP</status><clean_text></clean_text>
json (tagging / scoring / classification):
{"helpfulness": 4, "correctness": 4, "coherence": 4, "complexity": 1, "verbosity": 2}
adapter.py¶
adapter.py (in the repo root) provides prompt construction and output parsing:
build_prompt_from_row(row)— build a prompt from a case rowparse_output(text, output_format)— parse tagged_text or json outputCLI:
python adapter.py build-prompts .../python adapter.py parse-outputs ...
See the Integration Code section in README.md for full code snippets.