Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,41 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true

# The GitHub release is created from the same tag, with the notes taken from
# the CHANGELOG section for that version (scripts/release_notes.py), and the
# wheel and sdist attached. Only on a tag push: creating the release fires a
# `release: published` event that re-runs this workflow, and that run must not
# try to create it again.
github-release:
name: GitHub release
needs: [publish]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Release notes from CHANGELOG.md
run: |
python3 scripts/release_notes.py "${GITHUB_REF_NAME#v}" --check > notes.md
cat notes.md
- name: Create or update the release
env:
GH_TOKEN: ${{ github.token }}
run: |
tag="$GITHUB_REF_NAME"
pre=""
if [[ "${tag#v}" =~ [a-zA-Z] ]]; then pre="--prerelease"; fi
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release edit "$tag" --repo "$GITHUB_REPOSITORY" --title "$tag" --notes-file notes.md $pre
gh release upload "$tag" dist/* --repo "$GITHUB_REPOSITORY" --clobber
else
gh release create "$tag" dist/* --repo "$GITHUB_REPOSITORY" --title "$tag" --notes-file notes.md $pre --verify-tag
fi
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ learn-*/
*-learning-app*/
/logo/
todo-tui*/
textual-todo-app/
prime-numbers/
prime_numbers/
primes/
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ start typing. `/models` switches later.
> Implement the retry decorator in retry.py so every test in test_retry.py passes. Then run: pytest -q
```

`localcode --classic` opens the previous (0.3) interface.

Docs: [mjwsolo.github.io/localcode](https://mjwsolo.github.io/localcode/)

## What it does
Expand Down Expand Up @@ -86,7 +84,7 @@ localcode recommends a model by your Mac's memory and marks it with a star. You

Min RAM is the memory at which localcode will recommend the model. You can pick a heavier one by hand. DiffusionGemma is a research model that is never recommended automatically.

Measured on a MacBook Pro (M5 Max, 128 GB) with Qwen 3.6 35B-A3B UD-IQ2_M at a 131072-token context: about 89 tokens/s generation, about 1174 tokens/s prompt processing, and 12 to 15 seconds for a typical four-tool-call task.
Measured on a 128 GB Apple Silicon Mac with Qwen 3.6 35B-A3B UD-IQ2_M at a 131072-token context: about 89 tokens/s generation, about 1174 tokens/s prompt processing, and 12 to 15 seconds for a typical four-tool-call task.

## Network

Expand Down
53 changes: 53 additions & 0 deletions scripts/release_notes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
"""Print the CHANGELOG.md section for one version, for the GitHub release body.

scripts/release_notes.py 0.4.8 -> the "## 0.4.8 — ..." section body
scripts/release_notes.py 0.4.8 --check -> exit 1 when the section is missing or empty

Headings are "## <version> — <date>" (or "## <version> — unreleased"); the body
runs until the next "## " heading. The publish workflow calls this on every tag,
so a release always carries the notes that were written for it.
"""
from __future__ import annotations

import re
import sys
from pathlib import Path


def section(text: str, version: str) -> str | None:
lines = text.splitlines()
start = None
for i, line in enumerate(lines):
if re.match(rf"^## {re.escape(version)}(\s|$)", line):
start = i + 1
break
if start is None:
return None
body = []
for line in lines[start:]:
if line.startswith("## "):
break
body.append(line)
return "\n".join(body).strip() + "\n"


def main(argv: list[str]) -> int:
if not argv or argv[0].startswith("-"):
print(__doc__, file=sys.stderr)
return 2
version = argv[0].lstrip("v")
check = "--check" in argv[1:]
text = Path(__file__).resolve().parents[1].joinpath("CHANGELOG.md").read_text()
body = section(text, version)
if body is None or not body.strip():
if check:
print(f"CHANGELOG.md has no notes for {version}", file=sys.stderr)
return 1
body = f"See CHANGELOG.md for {version}.\n"
sys.stdout.write(body)
return 0


if __name__ == "__main__":
raise SystemExit(main(sys.argv[1:]))
10 changes: 0 additions & 10 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightVersions from 'starlight-versions';

// Preview docs site for localcode.
//
Expand All @@ -15,15 +14,6 @@ export default defineConfig({
integrations: [
starlight({
title: 'localcode',
plugins: [
// Versioned docs. The current tree documents the default interface
// (0.4+); `0.3` is a snapshot of the docs for the previous interface,
// still reachable with `localcode --classic`.
starlightVersions({
current: { label: '0.4' },
versions: [{ slug: '0.3', label: '0.3 · classic interface', redirect: 'root' }],
}),
],
description:
'An open-source coding agent that runs local models on Apple Silicon. No API key, and no remote inference unless you point it at one.',
components: {
Expand Down
116 changes: 2 additions & 114 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"@fontsource/inter": "^5.3.0",
"@fontsource/martian-mono": "^5.3.0",
"astro": "^7.2.3",
"sharp": "^0.35.3",
"starlight-versions": "^0.10.1"
"sharp": "^0.35.3"
},
"devDependencies": {
"@astrojs/check": "^0.9.4",
Expand Down
6 changes: 0 additions & 6 deletions website/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@
import Search from '@astrojs/starlight/components/Search.astro';
import MobileMenuToggle from '@astrojs/starlight/components/MobileMenuToggle.astro';
import SiteNav from './SiteNav.astro';
// The docs version switcher (starlight-versions). The plugin normally mounts it
// through Starlight's ThemeSelect slot, which this site overrides with nothing,
// so it is rendered here next to search instead.
import VersionSelect from 'starlight-versions/components/VersionSelect.astro';
---

<SiteNav search linkLabel="Home" linkHref="/">
<div slot="search" class="lc-docs-tools">
<Search />
<VersionSelect />
</div>
</SiteNav>

<style is:global>
.lc-docs-tools { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.lc-docs-tools > :first-child { flex: 1 1 auto; min-width: 0; }
.lc-docs-tools starlight-version-select { flex: 0 0 auto; }
</style>

<div class="lc-mobile-menu md:sl-hidden">
Expand Down
Loading
Loading