Text Generation
Transformers
Safetensors
code
fela
fourier-neural-operator
fno
gated-deltanet
cpu
on-device
autocomplete
fill-in-the-middle
constant-memory
custom_code
Eval Results (legacy)
Instructions to use lowdown-labs/fela-autocomplete with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lowdown-labs/fela-autocomplete with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lowdown-labs/fela-autocomplete", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("lowdown-labs/fela-autocomplete", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lowdown-labs/fela-autocomplete with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lowdown-labs/fela-autocomplete" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lowdown-labs/fela-autocomplete", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lowdown-labs/fela-autocomplete
- SGLang
How to use lowdown-labs/fela-autocomplete with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lowdown-labs/fela-autocomplete" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lowdown-labs/fela-autocomplete", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "lowdown-labs/fela-autocomplete" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lowdown-labs/fela-autocomplete", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lowdown-labs/fela-autocomplete with Docker Model Runner:
docker model run hf.co/lowdown-labs/fela-autocomplete
| import os | |
| import sys | |
| import gradio as gr | |
| import torch | |
| sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) | |
| from modeling import load_model | |
| WEIGHTS = os.environ.get("FELA_LLM_WEIGHTS", "..") | |
| try: | |
| torch.set_num_threads(4) | |
| MODEL = load_model(WEIGHTS, threads=4) | |
| except Exception as e: | |
| MODEL = None | |
| print(f"[Note] Model not loaded ({e}); the Space reports the input instead.") | |
| def complete(prefix, suffix, max_tokens): | |
| if MODEL is None: | |
| return "Weights not found. Set FELA_LLM_WEIGHTS to the repo directory." | |
| if not (prefix or "").strip() and (not (suffix or "").strip()): | |
| return "Type some code before the cursor (prefix), and optionally after it (suffix)." | |
| r = MODEL.complete(prefix or "", suffix or "", max_tokens=int(max_tokens)) | |
| tag = "fill in the middle" if r["used_fim"] else "continuation" | |
| return f"{r['middle']}\n\n[{tag}, {r['n_tokens']} tokens, {r['tok_per_s']} tok/s on CPU]" | |
| with gr.Blocks(title="FELA LLM 1.5 code completion") as demo: | |
| gr.Markdown( | |
| "# FELA LLM 1.5 code completion\nA CPU native code autocomplete model. Type the code before your cursor in Prefix, and optionally the code after your cursor in Suffix, and it writes the line that goes in between. It runs on a plain CPU with no GPU. This is the final fill in the middle model: single line patterns land well, multi line blocks and novel logic are outside what it is built for. Every completion is a real forward of the model." | |
| ) | |
| prefix = gr.Textbox( | |
| label="Prefix (code before the cursor)", value="def add(a, b):\n ", lines=4 | |
| ) | |
| suffix = gr.Textbox( | |
| label="Suffix (code after the cursor, optional)", | |
| value="\nresult = add(2, 3)\n", | |
| lines=2, | |
| ) | |
| max_tokens = gr.Slider(4, 64, value=16, step=1, label="Max tokens") | |
| out = gr.Textbox(label="Completed middle", lines=4) | |
| gr.Button("Complete").click(complete, [prefix, suffix, max_tokens], out) | |
| if __name__ == "__main__": | |
| demo.launch() | |