Metadata-Version: 2.5
Name: localise-opencode
Version: 1.0.0
Summary: Auto-detect and configure local LLMs for opencode
Project-URL: Repository, https://github.com/praneel/localise-opencode
Project-URL: Issues, https://github.com/praneel/localise-opencode/issues
Author: Praneel
License-Expression: MIT
License-File: LICENSE
Keywords: ai,llm,lmstudio,local,opencode
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: httpx>=0.25.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.9.0
Provides-Extra: dev
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# localise-opencode

Auto-detect and configure local LLMs for [opencode](https://opencode.ai).

**Version:** 1.0.0

## Installation

```bash
pip install localise-opencode
```

Or install from source:

```bash
git clone https://github.com/praneel/localise-opencode.git
cd localise-opencode
pip install -e .
```

## Prerequisites

- [LM Studio](https://lmstudio.ai/) running with a model loaded
- [opencode](https://opencode.ai) installed

## Usage

### Detect running servers

```bash
localise-opencode detect
```

### List available models

```bash
localise-opencode list
```

### Add a model to opencode

```bash
# Interactive mode - shows available models
localise-opencode add

# Add specific model
localise-opencode add llama-3.1-8b-instruct
```

### Check configuration

```bash
localise-opencode status
```

### Remove a model

```bash
# Interactive mode
localise-opencode remove -i

# Remove specific model
localise-opencode remove llama-3.1-8b-instruct
```

## Configuration

The tool modifies `~/.config/opencode/opencode.jsonc` to add your local LLM provider.

Example configuration added:

```jsonc
{
  "provider": {
    "lmstudio": {
      "name": "LM Studio",
      "base_url": "http://localhost:1234/v1",
      "api_key": "lm-studio",
      "models": {
        "llama-3.1-8b-instruct": {}
      }
    }
  }
}
```

## Development

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run linter
ruff check src/

# Run tests
localise-opencode test
```

## License

MIT
