ruby_llm-providers-lms 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +121 -0
  3. data/README.md +467 -104
  4. data/lib/ruby_llm/providers/lms/anthropic_messages.rb +28 -0
  5. data/lib/ruby_llm/providers/lms/endpoints.rb +18 -0
  6. data/lib/ruby_llm/providers/lms/model_management.rb +59 -0
  7. data/lib/ruby_llm/providers/lms/models.rb +44 -12
  8. data/lib/ruby_llm/providers/lms/native_chat/conversation.rb +93 -0
  9. data/lib/ruby_llm/providers/lms/native_chat/streaming.rb +67 -0
  10. data/lib/ruby_llm/providers/lms/native_chat.rb +134 -0
  11. data/lib/ruby_llm/providers/lms/native_v1.rb +97 -0
  12. data/lib/ruby_llm/providers/lms/responses.rb +47 -0
  13. data/lib/ruby_llm/providers/lms/version.rb +15 -0
  14. data/lib/ruby_llm/providers/lms.rb +51 -1
  15. data/models.json +69 -454
  16. metadata +12 -37
  17. data/.flayignore +0 -1
  18. data/.github/workflows/ci.yml +0 -29
  19. data/.github/workflows/gitleaks.yml +0 -22
  20. data/.github/workflows/release.yml +0 -36
  21. data/.overcommit.yml +0 -31
  22. data/.rspec +0 -2
  23. data/.rubocop.yml +0 -29
  24. data/Archspec.rb +0 -14
  25. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_openai_gpt_oss_20b_can_handle_a_multi_turn_conversation.yml +0 -92
  26. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_openai_gpt_oss_20b_can_have_a_basic_conversation.yml +0 -45
  27. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_openai_gpt_oss_20b_can_use_tools.yml +0 -129
  28. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_openai_gpt_oss_20b_returns_the_raw_response.yml +0 -73
  29. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_openai_gpt_oss_20b_supports_streaming_responses.yml +0 -81
  30. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_qwen3_0_6b_bible_assistant_can_have_a_basic_conversation.yml +0 -73
  31. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_qwen3_0_6b_bible_assistant_returns_structured_output.yml +0 -73
  32. data/spec/fixtures/vcr_cassettes/rubyllm_chat_lms_qwen3_0_6b_bible_assistant_returns_the_raw_response.yml +0 -73
  33. data/spec/fixtures/vcr_cassettes/rubyllm_embedding_lms_text_embedding_nomic_embed_text_v1_5_embeds_one_text.yml +0 -828
  34. data/spec/fixtures/vcr_cassettes/rubyllm_embedding_lms_text_embedding_nomic_embed_text_v1_5_embeds_several_texts.yml +0 -2375
  35. data/spec/ruby_llm/chat_schema_spec.rb +0 -30
  36. data/spec/ruby_llm/chat_spec.rb +0 -35
  37. data/spec/ruby_llm/chat_streaming_spec.rb +0 -22
  38. data/spec/ruby_llm/chat_tools_spec.rb +0 -30
  39. data/spec/ruby_llm/embedding_spec.rb +0 -49
  40. data/spec/ruby_llm/image_spec.rb +0 -23
  41. data/spec/ruby_llm/models_spec.rb +0 -11
  42. data/spec/ruby_llm/moderation_spec.rb +0 -22
  43. data/spec/ruby_llm/providers/lms/connection_guard_spec.rb +0 -47
  44. data/spec/ruby_llm/providers/lms_spec.rb +0 -153
  45. data/spec/ruby_llm/rerank_spec.rb +0 -23
  46. data/spec/ruby_llm/speech_spec.rb +0 -25
  47. data/spec/ruby_llm/video_spec.rb +0 -27
  48. data/spec/spec_helper.rb +0 -26
  49. data/spec/support/models.rb +0 -29
  50. data/spec/support/rubyllm_configuration.rb +0 -14
  51. data/spec/support/vcr_configuration.rb +0 -24
@@ -1,81 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "http://localhost:1234/v1/chat/completions"
6
- body:
7
- encoding: UTF-8
8
- string: '{"model":"openai/gpt-oss-20b","messages":[{"role":"user","content":"Count
9
- from 1 to 3"}],"stream":true,"stream_options":{"include_usage":true}}'
10
- headers:
11
- User-Agent:
12
- - Faraday v2.14.3
13
- Authorization:
14
- - Bearer <AUTH_TOKEN>
15
- Content-Type:
16
- - application/json
17
- Accept-Encoding:
18
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
- Accept:
20
- - "*/*"
21
- response:
22
- status:
23
- code: 200
24
- message: OK
25
- headers:
26
- X-Powered-By:
27
- - Express
28
- Content-Type:
29
- - text/event-stream
30
- Cache-Control:
31
- - no-cache
32
- Connection:
33
- - keep-alive
34
- Date:
35
- - Fri, 11 Sep 2026 17:28:00 GMT
36
- Transfer-Encoding:
37
- - chunked
38
- body:
39
- encoding: UTF-8
40
- string: |+
41
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"role":"assistant","reasoning":"User"},"logprobs":null,"finish_reason":null}]}
42
-
43
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":" wants"},"logprobs":null,"finish_reason":null}]}
44
-
45
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":" count"},"logprobs":null,"finish_reason":null}]}
46
-
47
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":" 1"},"logprobs":null,"finish_reason":null}]}
48
-
49
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":" to"},"logprobs":null,"finish_reason":null}]}
50
-
51
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":" 3"},"logprobs":null,"finish_reason":null}]}
52
-
53
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":"."},"logprobs":null,"finish_reason":null}]}
54
-
55
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":" Provide"},"logprobs":null,"finish_reason":null}]}
56
-
57
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":" sequence"},"logprobs":null,"finish_reason":null}]}
58
-
59
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"reasoning":"."},"logprobs":null,"finish_reason":null}]}
60
-
61
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"content":"1"},"logprobs":null,"finish_reason":null}]}
62
-
63
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
64
-
65
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"content":" 2"},"logprobs":null,"finish_reason":null}]}
66
-
67
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
68
-
69
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"content":" 3"},"logprobs":null,"finish_reason":null}]}
70
-
71
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{"content":""},"logprobs":null,"finish_reason":null}]}
72
-
73
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
74
-
75
- data: {"id":"chatcmpl-cvixai6ph3q3cdz9huvig6","object":"chat.completion.chunk","created":1789147680,"model":"openai/gpt-oss-20b","system_fingerprint":"openai/gpt-oss-20b","choices":[],"usage":{"prompt_tokens":74,"completion_tokens":29,"total_tokens":103,"completion_tokens_details":{"reasoning_tokens":12}}}
76
-
77
- data: [DONE]
78
-
79
- recorded_at: Fri, 11 Sep 2026 17:28:01 GMT
80
- recorded_with: VCR 6.4.0
81
- ...
@@ -1,73 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "http://localhost:1234/v1/chat/completions"
6
- body:
7
- encoding: UTF-8
8
- string: '{"model":"qwen3-0.6b-bible-assistant","messages":[{"role":"user","content":"What''s
9
- 2 + 2?"}],"stream":false}'
10
- headers:
11
- User-Agent:
12
- - Faraday v2.14.3
13
- Authorization:
14
- - Bearer <AUTH_TOKEN>
15
- Content-Type:
16
- - application/json
17
- Accept-Encoding:
18
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
- Accept:
20
- - "*/*"
21
- response:
22
- status:
23
- code: 200
24
- message: OK
25
- headers:
26
- X-Powered-By:
27
- - Express
28
- Content-Type:
29
- - application/json; charset=utf-8
30
- Content-Length:
31
- - '1584'
32
- Etag:
33
- - W/"630-uxTKlpT7zFB12JjOC6YqfjQu48o"
34
- Date:
35
- - Fri, 11 Sep 2026 17:27:15 GMT
36
- Connection:
37
- - keep-alive
38
- Keep-Alive:
39
- - timeout=5
40
- body:
41
- encoding: UTF-8
42
- string: |-
43
- {
44
- "id": "chatcmpl-4gslx40t72mvc15qpsyea",
45
- "object": "chat.completion",
46
- "created": 1789147635,
47
- "model": "qwen3-0.6b-bible-assistant",
48
- "choices": [
49
- {
50
- "index": 0,
51
- "message": {
52
- "role": "assistant",
53
- "content": "{\"issue_question\": \"\", \"verse\": \"Matthew 11:30-34 - For this is good, and pleasing to God. But if you have anything to give, give it all; and if not, give to a friend, and to a neighbor in need. Whoever receives evil will be tempted again when he is about to receive it.\", \"explanation\": \"Matthew 11:30-34 teaches that generosity is good and pleasing to God, but the way you distribute your resources matters. It encourages giving everything (not being burdened) and giving to others in need while also considering relationships with friends. This shifts the focus from hoarding to serving others and sharing without fear of loss.\", \"guidance\": [\"Give all as possible options, even if it means helping someone else.\", \"Focus on supporting others rather than controlling resources.\", \"Be mindful of your limits; give what you cannot afford or have less confidence in.\", \"Set clear boundaries so you don't overextend yourself.\"], \"note\": \"\"}",
54
- "reasoning_content": "",
55
- "tool_calls": []
56
- },
57
- "logprobs": null,
58
- "finish_reason": "stop"
59
- }
60
- ],
61
- "usage": {
62
- "prompt_tokens": 16,
63
- "completion_tokens": 217,
64
- "total_tokens": 233,
65
- "completion_tokens_details": {
66
- "reasoning_tokens": 0
67
- }
68
- },
69
- "stats": {},
70
- "system_fingerprint": "qwen3-0.6b-bible-assistant"
71
- }
72
- recorded_at: Fri, 11 Sep 2026 17:27:15 GMT
73
- recorded_with: VCR 6.4.0
@@ -1,73 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "http://localhost:1234/v1/chat/completions"
6
- body:
7
- encoding: UTF-8
8
- string: '{"model":"qwen3-0.6b-bible-assistant","messages":[{"role":"user","content":"Generate
9
- a person named John who is 30 years old"}],"stream":false,"response_format":{"type":"json_schema","json_schema":{"name":"response","schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}},"required":["name","age"],"additionalProperties":false},"strict":true}}}'
10
- headers:
11
- User-Agent:
12
- - Faraday v2.14.3
13
- Authorization:
14
- - Bearer <AUTH_TOKEN>
15
- Content-Type:
16
- - application/json
17
- Accept-Encoding:
18
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
- Accept:
20
- - "*/*"
21
- response:
22
- status:
23
- code: 200
24
- message: OK
25
- headers:
26
- X-Powered-By:
27
- - Express
28
- Content-Type:
29
- - application/json; charset=utf-8
30
- Content-Length:
31
- - '651'
32
- Etag:
33
- - W/"28b-lfratyRiXi0QpzlkqmrOxIv8YeU"
34
- Date:
35
- - Fri, 11 Sep 2026 17:29:07 GMT
36
- Connection:
37
- - keep-alive
38
- Keep-Alive:
39
- - timeout=5
40
- body:
41
- encoding: UTF-8
42
- string: |-
43
- {
44
- "id": "chatcmpl-84akgcg8nqgsycjy9uwqxh",
45
- "object": "chat.completion",
46
- "created": 1789147746,
47
- "model": "qwen3-0.6b-bible-assistant",
48
- "choices": [
49
- {
50
- "index": 0,
51
- "message": {
52
- "role": "assistant",
53
- "content": "{\"name\": \"John\", \"age\": 30}",
54
- "reasoning_content": "",
55
- "tool_calls": []
56
- },
57
- "logprobs": null,
58
- "finish_reason": "stop"
59
- }
60
- ],
61
- "usage": {
62
- "prompt_tokens": 20,
63
- "completion_tokens": 18,
64
- "total_tokens": 38,
65
- "completion_tokens_details": {
66
- "reasoning_tokens": 0
67
- }
68
- },
69
- "stats": {},
70
- "system_fingerprint": "qwen3-0.6b-bible-assistant"
71
- }
72
- recorded_at: Fri, 11 Sep 2026 17:29:07 GMT
73
- recorded_with: VCR 6.4.0
@@ -1,73 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "http://localhost:1234/v1/chat/completions"
6
- body:
7
- encoding: UTF-8
8
- string: '{"model":"qwen3-0.6b-bible-assistant","messages":[{"role":"user","content":"What
9
- is the capital of France?"}],"stream":false}'
10
- headers:
11
- User-Agent:
12
- - Faraday v2.14.3
13
- Authorization:
14
- - Bearer <AUTH_TOKEN>
15
- Content-Type:
16
- - application/json
17
- Accept-Encoding:
18
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
- Accept:
20
- - "*/*"
21
- response:
22
- status:
23
- code: 200
24
- message: OK
25
- headers:
26
- X-Powered-By:
27
- - Express
28
- Content-Type:
29
- - application/json; charset=utf-8
30
- Content-Length:
31
- - '649'
32
- Etag:
33
- - W/"289-z0+P8ZlD0mrrOcJUeEGw9Sfrl2Q"
34
- Date:
35
- - Fri, 11 Sep 2026 17:27:15 GMT
36
- Connection:
37
- - keep-alive
38
- Keep-Alive:
39
- - timeout=5
40
- body:
41
- encoding: UTF-8
42
- string: |-
43
- {
44
- "id": "chatcmpl-ajko3wpu2rrkmje2qrqcts",
45
- "object": "chat.completion",
46
- "created": 1789147635,
47
- "model": "qwen3-0.6b-bible-assistant",
48
- "choices": [
49
- {
50
- "index": 0,
51
- "message": {
52
- "role": "assistant",
53
- "content": "The capital of France is Paris.",
54
- "reasoning_content": "",
55
- "tool_calls": []
56
- },
57
- "logprobs": null,
58
- "finish_reason": "stop"
59
- }
60
- ],
61
- "usage": {
62
- "prompt_tokens": 15,
63
- "completion_tokens": 12,
64
- "total_tokens": 27,
65
- "completion_tokens_details": {
66
- "reasoning_tokens": 0
67
- }
68
- },
69
- "stats": {},
70
- "system_fingerprint": "qwen3-0.6b-bible-assistant"
71
- }
72
- recorded_at: Fri, 11 Sep 2026 17:27:15 GMT
73
- recorded_with: VCR 6.4.0