Metadata-Version: 2.4
Name: devsllm
Version: 1.0.0
Summary: DevsLLM — 38 text providers behind one OpenAI-compatible interface, with honest failover.
Author-email: Adarshukumar <adarshukumar@users.noreply.github.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/Adarshukumar/devsllm
Project-URL: Repository, https://github.com/Adarshukumar/devsllm
Project-URL: Issues, https://github.com/Adarshukumar/devsllm/issues
Keywords: llm,openai-compatible,text-generation,providers,failover,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE-APACHE-2.0.txt
Requires-Dist: typing_extensions
Requires-Dist: rich
Requires-Dist: pydantic
Requires-Dist: litprinter
Requires-Dist: tqdm
Requires-Dist: packaging
Requires-Dist: nest-asyncio
Requires-Dist: colorama
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Provides-Extra: impersonate
Requires-Dist: primp; extra == "impersonate"
Provides-Extra: docs
Requires-Dist: mkdocs-material; extra == "docs"
Dynamic: license-file

# DevsLLM

**One Python interface for text chat across providers.**

DevsLLM combines an OpenAI-shaped chat interface, provider routing, failover, streaming, a command-line tool, and a local HTTP server.

- 💬 Make a simple request with `Client().ask()` or use `chat.completions.create()`.
- 🔀 Try another eligible provider when an attempt fails or returns an empty response.
- ⚡ Stream responses and inspect the failure trail when no provider succeeds.
- 🎯 Choose a provider or model, or let the client plan a candidate chain.
- 🖥️ Use the CLI or run a local server with a subset of the OpenAI chat API.

## Install

Requires Python 3.10 or newer:

```bash
python -m pip install devsllm
```

## Your first request

```python
from devsllm import Client, NoProviderAvailable

client = Client(attempts=3, timeout=25)

try:
    print(client.ask("Explain an API in one sentence."))
except NoProviderAvailable as error:
    print("No provider succeeded:", error)
    for attempt in error.trail:
        print(" -", attempt)
```

## OpenAI-shaped chat

```python
from devsllm import Client

client = Client()
response = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "What is an API?"}],
)
print(response.choices[0].message.content)
```

## Command line

```bash
devsllm version
devsllm providers
devsllm models
devsllm ask "Hello"
```

## Local HTTP server

```bash
devsllm serve --port 8099
```

The server listens on `127.0.0.1` by default. It has **no built-in authentication or TLS** and should not be exposed to untrusted networks without suitable protection.

## Important notes

- Provider and model listings describe configured candidates, not live health checks. Availability and feature support vary.
- Requests go to third-party services; automatic failover can send the same prompt to multiple providers. Review their privacy policies before sending sensitive data.
- A timeout limits the caller's wait but cannot kill provider code that is still running. After streaming starts, mid-stream failover is not available.
- Some providers need credentials, optional dependencies, or browser setup. Use your own credentials and do not commit them.

For the full guides, examples, provider notes, and source code, visit the [DevsLLM repository](https://github.com/Adarshukumar/devsllm). The documentation there reflects the version currently published to that repository.

## License

Apache-2.0. The distribution includes the license and applicable notices.
