diff --git a/tests/integration/common/recordings/models-64a2277c90f0f42576f60c1030e3a020403d34a95f56931b792d5939f4cebc57-ab2bd94b.json b/tests/integration/common/recordings/models-64a2277c90f0f42576f60c1030e3a020403d34a95f56931b792d5939f4cebc57-ab2bd94b.json new file mode 100644 index 000000000..1e6c4dc82 --- /dev/null +++ b/tests/integration/common/recordings/models-64a2277c90f0f42576f60c1030e3a020403d34a95f56931b792d5939f4cebc57-ab2bd94b.json @@ -0,0 +1,80 @@ +{ + "test_id": null, + "request": { + "method": "POST", + "url": "http://0.0.0.0:11434/v1/v1/models", + "headers": {}, + "body": {}, + "endpoint": "/v1/models", + "model": "" + }, + "response": { + "body": [ + { + "__type__": "openai.types.model.Model", + "__data__": { + "id": "llama3.2-vision:11b", + "created": 1759959879, + "object": "model", + "owned_by": "library" + } + }, + { + "__type__": "openai.types.model.Model", + "__data__": { + "id": "nomic-embed-text:latest", + "created": 1754610899, + "object": "model", + "owned_by": "library" + } + }, + { + "__type__": "openai.types.model.Model", + "__data__": { + "id": "llama-guard3:1b", + "created": 1754088388, + "object": "model", + "owned_by": "library" + } + }, + { + "__type__": "openai.types.model.Model", + "__data__": { + "id": "all-minilm:l6-v2", + "created": 1753826826, + "object": "model", + "owned_by": "library" + } + }, + { + "__type__": "openai.types.model.Model", + "__data__": { + "id": "all-minilm:latest", + "created": 1749064003, + "object": "model", + "owned_by": "library" + } + }, + { + "__type__": "openai.types.model.Model", + "__data__": { + "id": "llama3.1:8b-instruct-fp16", + "created": 1739575404, + "object": "model", + "owned_by": "library" + } + }, + { + "__type__": "openai.types.model.Model", + "__data__": { + "id": "llama3.2:3b-instruct-fp16", + "created": 1737496003, + "object": "model", + "owned_by": "library" + } + } + ], + "is_streaming": false + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/inference/recordings/8567635651a5e7104394951bbbba040e5c7f3ba11084fb6e81328f4905100a65.json b/tests/integration/inference/recordings/8567635651a5e7104394951bbbba040e5c7f3ba11084fb6e81328f4905100a65.json new file mode 100644 index 000000000..8e622eeaf --- /dev/null +++ b/tests/integration/inference/recordings/8567635651a5e7104394951bbbba040e5c7f3ba11084fb6e81328f4905100a65.json @@ -0,0 +1,991 @@ +{ + "test_id": "tests/integration/inference/test_openai_completion.py::test_openai_completion_streaming[txt=ollama/llama3.2:3b-instruct-fp16-inference:completion:sanity]", + "request": { + "method": "POST", + "url": "http://0.0.0.0:11434/v1/v1/completions", + "headers": {}, + "body": { + "model": "llama3.2:3b-instruct-fp16", + "prompt": "Respond to this question and explain your answer. Complete the sentence using one word: Roses are red, violets are ", + "max_tokens": 50, + "stream": true + }, + "endpoint": "/v1/completions", + "model": "llama3.2:3b-instruct-fp16" + }, + "response": { + "body": [ + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "blue" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": ".\n\n" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "The" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " classic" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " nursery" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " rhyme" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " goes" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": ":\n\n" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "R" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "oses" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " are" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " red" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": ",\n" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "V" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "io" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "lets" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " are" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " blue" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": ".\n" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "Sugar" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " is" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " sweet" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": ",\n" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "And" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " so" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " are" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " you" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": ".\n\n" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "This" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " completes" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " the" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " traditional" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " rhyme" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " with" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " the" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " second" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " line" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " being" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " \"" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "vio" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "lets" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " are" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " blue" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": "\"," + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " which" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " has" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " been" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " a" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " ubiquitous" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": null, + "index": 0, + "logprobs": null, + "text": " and" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + }, + { + "__type__": "openai.types.completion.Completion", + "__data__": { + "id": "rec-8567635651a5", + "choices": [ + { + "finish_reason": "length", + "index": 0, + "logprobs": null, + "text": "" + } + ], + "created": 0, + "model": "llama3.2:3b-instruct-fp16", + "object": "text_completion", + "system_fingerprint": "fp_ollama", + "usage": null + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +}