programasweights 0.4.8__tar.gz → 0.4.9__tar.gz

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 (26) hide show
  1. {programasweights-0.4.8 → programasweights-0.4.9}/CHANGELOG.md +7 -0
  2. {programasweights-0.4.8 → programasweights-0.4.9}/PKG-INFO +15 -12
  3. {programasweights-0.4.8 → programasweights-0.4.9}/PYPI_README.md +14 -11
  4. {programasweights-0.4.8 → programasweights-0.4.9}/README.md +14 -11
  5. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/__init__.py +8 -4
  6. {programasweights-0.4.8 → programasweights-0.4.9}/pyproject.toml +1 -1
  7. {programasweights-0.4.8 → programasweights-0.4.9}/.gitignore +0 -0
  8. {programasweights-0.4.8 → programasweights-0.4.9}/LICENSE +0 -0
  9. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/_output.py +0 -0
  10. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/_program_reference.py +0 -0
  11. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/_remote.py +0 -0
  12. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/artifacts.py +0 -0
  13. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/cache.py +0 -0
  14. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/cli.py +0 -0
  15. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/client.py +0 -0
  16. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/compiler/__init__.py +0 -0
  17. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/compiler/dummy.py +0 -0
  18. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/config.py +0 -0
  19. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/convert_peft_to_paw.py +0 -0
  20. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/errors.py +0 -0
  21. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/local_program.py +0 -0
  22. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/paw_format.py +0 -0
  23. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/runtime/__init__.py +0 -0
  24. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/runtime/interpreter.py +0 -0
  25. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/runtime/interpreter_onnx.py +0 -0
  26. {programasweights-0.4.8 → programasweights-0.4.9}/programasweights/runtime_llamacpp.py +0 -0
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.9 (2026-09-21)
4
+
5
+ - Lead quickstarts and examples with compiling your own functions, then
6
+ saving and reusing program IDs.
7
+ - Reuse loaded functions in the LangChain example and serialize calls to
8
+ each shared instance.
9
+
3
10
  ## 0.4.8 (2026-09-20)
4
11
 
5
12
  - Reduce the source distribution to the SDK and files needed to build and
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: programasweights
3
- Version: 0.4.8
3
+ Version: 0.4.9
4
4
  Summary: Compile natural language specifications into neural programs that run locally via llama.cpp.
5
5
  Project-URL: Homepage, https://programasweights.com
6
6
  Project-URL: Repository, https://github.com/programasweights/programasweights-python
@@ -46,22 +46,21 @@ pip install programasweights --extra-index-url https://pypi.programasweights.com
46
46
  ```python
47
47
  import programasweights as paw
48
48
 
49
- # Use a pre-compiled function (downloads once, runs locally forever)
50
- fn = paw.function("email-triage")
49
+ # Compile and load your own function
50
+ fn = paw.compile_and_load(
51
+ "Classify if a message needs immediate attention or can wait. "
52
+ "Return only 'immediate' or 'wait'."
53
+ )
51
54
  fn("Urgent: the server is down!") # "immediate"
52
55
  fn("Newsletter: spring picnic") # "wait"
53
56
 
54
- # Compile your own from a description
57
+ # Compile once and save the program ID
55
58
  program = paw.compile(
56
- "Fix malformed JSON: repair missing quotes and trailing commas",
57
- slug="json-fixer" # optional: creates username/json-fixer handle
59
+ "Fix malformed JSON: repair missing quotes and trailing commas"
58
60
  )
59
- fn = paw.function(program.slug) # or paw.function(program.id)
61
+ print(program.id) # Save this ID for future runs
62
+ fn = paw.function(program.id)
60
63
  fn("{name: 'Alice',}") # '{"name":"Alice"}'
61
-
62
- # Or compile and load in one step
63
- fn = paw.compile_and_load("Classify sentiment as positive or negative")
64
- fn("I love this!") # "positive"
65
64
  ```
66
65
 
67
66
  If you specifically want the smaller browser-compatible runtime, pass `compiler="paw-4b-gpt2"`. Otherwise, omit `compiler` and let the server default decide.
@@ -73,7 +72,11 @@ Use the hosted API for fast inference in around 150 ms, without a local model do
73
72
  ```python
74
73
  import programasweights as paw
75
74
 
76
- with paw.function("email-triage", remote=True) as remote_fn:
75
+ with paw.compile_and_load(
76
+ "Classify if a message needs immediate attention or can wait. "
77
+ "Return only 'immediate' or 'wait'.",
78
+ remote=True,
79
+ ) as remote_fn:
77
80
  print(remote_fn("Urgent: the server is down!"))
78
81
  ```
79
82
 
@@ -15,22 +15,21 @@ pip install programasweights --extra-index-url https://pypi.programasweights.com
15
15
  ```python
16
16
  import programasweights as paw
17
17
 
18
- # Use a pre-compiled function (downloads once, runs locally forever)
19
- fn = paw.function("email-triage")
18
+ # Compile and load your own function
19
+ fn = paw.compile_and_load(
20
+ "Classify if a message needs immediate attention or can wait. "
21
+ "Return only 'immediate' or 'wait'."
22
+ )
20
23
  fn("Urgent: the server is down!") # "immediate"
21
24
  fn("Newsletter: spring picnic") # "wait"
22
25
 
23
- # Compile your own from a description
26
+ # Compile once and save the program ID
24
27
  program = paw.compile(
25
- "Fix malformed JSON: repair missing quotes and trailing commas",
26
- slug="json-fixer" # optional: creates username/json-fixer handle
28
+ "Fix malformed JSON: repair missing quotes and trailing commas"
27
29
  )
28
- fn = paw.function(program.slug) # or paw.function(program.id)
30
+ print(program.id) # Save this ID for future runs
31
+ fn = paw.function(program.id)
29
32
  fn("{name: 'Alice',}") # '{"name":"Alice"}'
30
-
31
- # Or compile and load in one step
32
- fn = paw.compile_and_load("Classify sentiment as positive or negative")
33
- fn("I love this!") # "positive"
34
33
  ```
35
34
 
36
35
  If you specifically want the smaller browser-compatible runtime, pass `compiler="paw-4b-gpt2"`. Otherwise, omit `compiler` and let the server default decide.
@@ -42,7 +41,11 @@ Use the hosted API for fast inference in around 150 ms, without a local model do
42
41
  ```python
43
42
  import programasweights as paw
44
43
 
45
- with paw.function("email-triage", remote=True) as remote_fn:
44
+ with paw.compile_and_load(
45
+ "Classify if a message needs immediate attention or can wait. "
46
+ "Return only 'immediate' or 'wait'.",
47
+ remote=True,
48
+ ) as remote_fn:
46
49
  print(remote_fn("Urgent: the server is down!"))
47
50
  ```
48
51
 
@@ -15,22 +15,21 @@ pip install programasweights --extra-index-url https://pypi.programasweights.com
15
15
  ```python
16
16
  import programasweights as paw
17
17
 
18
- # Use a pre-compiled function (downloads once, runs locally forever)
19
- fn = paw.function("email-triage")
18
+ # Compile and load your own function
19
+ fn = paw.compile_and_load(
20
+ "Classify if a message needs immediate attention or can wait. "
21
+ "Return only 'immediate' or 'wait'."
22
+ )
20
23
  fn("Urgent: the server is down!") # "immediate"
21
24
  fn("Newsletter: spring picnic") # "wait"
22
25
 
23
- # Compile your own from a description
26
+ # Compile once and save the program ID
24
27
  program = paw.compile(
25
- "Fix malformed JSON: repair missing quotes and trailing commas",
26
- slug="json-fixer" # optional: creates username/json-fixer handle
28
+ "Fix malformed JSON: repair missing quotes and trailing commas"
27
29
  )
28
- fn = paw.function(program.slug) # or paw.function(program.id)
30
+ print(program.id) # Save this ID for future runs
31
+ fn = paw.function(program.id)
29
32
  fn("{name: 'Alice',}") # '{"name":"Alice"}'
30
-
31
- # Or compile and load in one step
32
- fn = paw.compile_and_load("Classify sentiment as positive or negative")
33
- fn("I love this!") # "positive"
34
33
  ```
35
34
 
36
35
  If you specifically want the smaller browser-compatible runtime, pass `compiler="paw-4b-gpt2"`. Otherwise, omit `compiler` and let the server default decide.
@@ -42,7 +41,11 @@ Use the hosted API for fast inference in around 150 ms, without a local model do
42
41
  ```python
43
42
  import programasweights as paw
44
43
 
45
- with paw.function("email-triage", remote=True) as remote_fn:
44
+ with paw.compile_and_load(
45
+ "Classify if a message needs immediate attention or can wait. "
46
+ "Return only 'immediate' or 'wait'.",
47
+ remote=True,
48
+ ) as remote_fn:
46
49
  print(remote_fn("Urgent: the server is down!"))
47
50
  ```
48
51
 
@@ -5,12 +5,16 @@ functions that run locally.
5
5
  Quick start:
6
6
  import programasweights as paw
7
7
 
8
- # Use a pre-compiled function (downloads once, runs locally forever)
9
- fn = paw.function("email-triage")
8
+ # Compile and load your own function
9
+ fn = paw.compile_and_load(
10
+ "Classify if a message needs immediate attention or can wait. "
11
+ "Return only 'immediate' or 'wait'."
12
+ )
10
13
  fn("Urgent: server is down!") # "immediate"
11
14
 
12
- # Compile your own from a description
15
+ # Compile once and save the program ID
13
16
  program = paw.compile("Fix malformed JSON: repair missing quotes and trailing commas")
17
+ print(program.id) # Save this ID for future runs
14
18
  fn = paw.function(program.id)
15
19
  fn("{name: 'Alice',}") # '{"name":"Alice"}'
16
20
 
@@ -27,7 +31,7 @@ try:
27
31
  from importlib.metadata import version as _meta_version
28
32
  __version__ = _meta_version("programasweights")
29
33
  except Exception:
30
- __version__ = "0.4.8"
34
+ __version__ = "0.4.9"
31
35
 
32
36
  from ._output import ProgressCallback, ProgressEvent, report_progress
33
37
  from .cache import CachedProgram
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "programasweights"
7
- version = "0.4.8"
7
+ version = "0.4.9"
8
8
  description = "Compile natural language specifications into neural programs that run locally via llama.cpp."
9
9
  readme = "PYPI_README.md"
10
10
  requires-python = ">=3.9"