feat: add local model support (RamaLama) with optional managed lifecycle#8
Merged
feat: add local model support (RamaLama) with optional managed lifecycle#8
Conversation
Owner
pridolfi
commented
Mar 18, 2026
- Add OpenAI-compatible local backend (SSHQ_USE_LOCAL, SSHQ_LOCAL_BASE_URL, SSHQ_LOCAL_MODEL); default model llama3.2:1b for Ollama/RamaLama
- When SSHQ_USE_LOCAL=1 and SSHQ_LOCAL_BASE_URL unset, start RamaLama on connect (port 8080 or SSHQ_RAMALAMA_PORT) and stop it on disconnect
- Extend backends with max_tokens (256 for /ask, 1024 for /analyze) to cap repetition; add optional max_tokens to Gemini/Groq/local
- Post-process /ask responses: strip markdown code blocks and return a single shell command; add system prompt rule to avoid unnecessary sudo
- Allow CLI to run without API keys when SSHQ_USE_LOCAL=1
- Document local/managed mode and env vars in README; add tests for backend selection and command extraction
- Add OpenAI-compatible local backend (SSHQ_USE_LOCAL, SSHQ_LOCAL_BASE_URL, SSHQ_LOCAL_MODEL); default model llama3.2:1b for Ollama/RamaLama - When SSHQ_USE_LOCAL=1 and SSHQ_LOCAL_BASE_URL unset, start RamaLama on connect (port 8080 or SSHQ_RAMALAMA_PORT) and stop it on disconnect - Extend backends with max_tokens (256 for /ask, 1024 for /analyze) to cap repetition; add optional max_tokens to Gemini/Groq/local - Post-process /ask responses: strip markdown code blocks and return a single shell command; add system prompt rule to avoid unnecessary sudo - Allow CLI to run without API keys when SSHQ_USE_LOCAL=1 - Document local/managed mode and env vars in README; add tests for backend selection and command extraction Signed-off-by: Pablo Ridolfi <pridolfi@redhat.com>
- Add tests/test_functional.py: spawns Podman aarch64 Ubuntu container, runs sshq server with mocked backend, SSHs with reverse tunnel, runs "q replace foo by bar in test.txt" and "q --analyze /proc/cpuinfo show cpu features...", asserts expected command and CPU features output. - Add tests/docker/Dockerfile: Ubuntu 24.04 with openssh-server and python3 for the test container. Test builds image with its public key copied in (avoids rootless Podman bind-mount ownership issues). - Register pytest marker "functional" in pyproject.toml. Test skips when Podman is not available. Signed-off-by: Pablo Ridolfi <pridolfi@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.