Metadata-Version: 2.4
Name: skylar
Version: 0.1.0
Summary: Skylar — local, sovereign, from-scratch LLMs. CLI + loader for the Skylar model family (COBOL specialist & more).
Author: A. Ivanovitch
License: Apache-2.0
Project-URL: Models, https://huggingface.co/Sophia-AI
Keywords: llm,cobol,code-generation,sovereign-ai,from-scratch
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.1
Requires-Dist: transformers>=4.40
Requires-Dist: tokenizers>=0.15
Requires-Dist: huggingface_hub>=0.20
Requires-Dist: rich>=13.0
Provides-Extra: serve
Requires-Dist: fastapi>=0.100; extra == "serve"
Requires-Dist: uvicorn>=0.23; extra == "serve"
Requires-Dist: pydantic>=2.0; extra == "serve"

# skylar

Local, sovereign, **from-scratch** LLMs — a tiny runtime + CLI for the Skylar model family.
First release ships the **COBOL specialist** (`Sophia-AI/SkylarCobol-390M`): a 390M model that
beats 7B general code models on COBOL generation, small enough to run on a single GPU (or CPU).

## Install

```bash
pip install skylar
# optional HTTP server:
pip install "skylar[serve]"
```

## Use it — CLI

```bash
# interactive chat (auto-downloads the model from HuggingFace the first time)
skylar chat

# one-shot completion
skylar generate --prompt "Scrivi un sottoprogramma COBOL che somma due interi in RESULT."

# point at a different model or a local checkpoint
skylar chat   --model Sophia-AI/SkylarCobol-390M
skylar generate --model ./my-checkpoint --prompt "..."

# OpenAI-compatible server (needs the [serve] extra)
skylar serve --port 8000
#   POST /generate                {"prompt": "..."}
#   POST /v1/chat/completions     {"messages": [...]}
```

By default the system prompt is *"Sei un esperto programmatore COBOL."* and decoding is greedy
(`--temperature 0.0`). Override with `--system` / `--temperature`.

## Use it — Python

```python
import skylar

m = skylar.load("Sophia-AI/SkylarCobol-390M")          # or a local dir
print(m.generate("Complete a COBOL paragraph that stores the max of two numbers in RESULT."))

for delta in m.stream("..."):                          # streaming
    print(delta, end="", flush=True)
```

`skylar` also registers the architecture with 🤗 Transformers, so this works too:

```python
import skylar  # registers nano-transformer
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("Sophia-AI/SkylarCobol-390M")
```

## What's inside

The Skylar models use a custom decoder (`NanoTransformer`, Qwen3-style: RMSNorm + RoPE + GQA +
QK-Norm + SwiGLU), trained 100% from scratch (no third-party pretrained weights). This package
vendors the architecture so the published weights load anywhere — no private framework needed.

## License

Apache-2.0. Models & code IP: A. Ivanovitch (Sophia AI).
