Skip to main content

Add your description here

Project description

code-assistant

A FastHTML app that makes FastHTML apps.

Features and Roadmap:

Guiding the LLM

  • LSP support (code actions)
  • LSP support (retrieve diagnostics)
  • LSP Support (linter/formatter with ruff server)
  • LSP Support (type checker, use pyright or wait for ruff red-knot? https://github.com/astral-sh/ruff/issues/12701)
  • LSP support (use diagnostics in LLM context)
  • Self-healing (backend runtime errors)
  • Self-healing (frontend runtime errors)
  • python indentation helper with tree sitter
  • FastHTML specific validations using ast-grep
  • FastHTML documentation llm context
  • HTMX documentation llm context
  • fastlite documentation llm context
  • fastsql documentation llm context
  • fastastra documentation llm context
  • dynamic openapi spec llm context
  • dynamic sample apps llm context
  • astra-assistants documentation llm context
  • Multi-file support
  • Multi-turn generation

UI/UX

  • Live app preview
  • Drive generated_apps dir with env var CA_GENERATED_APPS_DIR
  • Add third party model support to frontend
  • Improve third party auth
  • ollama integration guide / docs

Multi-tenancy

  • Sessions
  • Sandboxing (probably with e2b)

code-assistant is built on OpenAI's Assistant API and uses astra-assistants to support other models including claude and local models.

Install and run

Install with pip:

pip install code-assistant

Run:

code-assistant

this will start the web server on port 5001 and will create a generated_apps directory on your current working directory. You can override this directory by setting the CA_GENERATED_APPS_DIR environment variable.

export CA_GENERATED_APPS_DIR="~/my_apps"
code-assistant

Run as an isolated program

use pipx or uvx if you're a uv user to run as an isolated program:

pipx run code-assistant

or

uvx code-assistant

Third party LLM provider Authentication

If you have not provided credentials via env vars the UI will prompt you for credentials. Credentials inputed via the UI are not persisted.

To avoid manual entry, set up environment variables for astradb [required for any non OpenAI models] and your LLM provider of choice.:

#!/bin/bash

# AstraDB -> https://astra.datastax.com/ --> tokens --> administrator user --> generate
export ASTRA_DB_APPLICATION_TOKEN=""

# OpenAI Models - https://platform.openai.com/api-keys --> create new secret key
export OPENAI_API_KEY=""

# Groq Models - https://console.groq.com/keys
export GROQ_API_KEY=""

# Anthropic claude models - https://console.anthropic.com/settings/keys
export ANTHROPIC_API_KEY=""

# Gemini models -> https://makersuite.google.com/app/apikey
export GEMINI_API_KEY=""

# Perplexity models -> https://www.perplexity.ai/settings/api  --> generate
export PERPLEXITYAI_API_KEY=""

# Cohere models -> https://dashboard.cohere.com/api-keys
export COHERE_API_KEY=""

# Bedrock models -> https://docs.aws.amazon.com/bedrock/latest/userguide/setting-up.html
export AWS_REGION_NAME=""
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""

# vertexai models https://console.cloud.google.com/vertex-ai
export GOOGLE_JSON_PATH=""
export GOOGLE_PROJECT_ID=""

# ... for other models see https://github.com/datastax/astra-assistants-api/blob/main/.env.bkp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_assistant-0.1.0.1rc0.tar.gz (259.8 kB view details)

Uploaded Source

Built Distribution

code_assistant-0.1.0.1rc0-py3-none-any.whl (129.7 kB view details)

Uploaded Python 3

File details

Details for the file code_assistant-0.1.0.1rc0.tar.gz.

File metadata

  • Download URL: code_assistant-0.1.0.1rc0.tar.gz
  • Upload date:
  • Size: 259.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for code_assistant-0.1.0.1rc0.tar.gz
Algorithm Hash digest
SHA256 238b4a3080002e96978f5f8e72970c1fb0e958dafd037e1bf27ba3a83794e36e
MD5 b5a3808bc62d56d1558847d2bff9a485
BLAKE2b-256 9e10530e046c2af29d7f4c765d0643f770f2c247581c3d3372dc9b9a17edf3bc

See more details on using hashes here.

File details

Details for the file code_assistant-0.1.0.1rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for code_assistant-0.1.0.1rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a5897106fb2c86e10717ce49ecd80b71aa518738c6688462b2ffa79bab5c48f
MD5 3a4f6a31f4bb773718c714607533a0ad
BLAKE2b-256 67f81016fc54e6f1a812ebf05b8cde2301ca8a80e4df5f7a28626057882ba25a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page